
Estoy intentando descargar un archivo en mi Mac, pero los requisitos para obtener el archivo son muy estrictos:
Username: testx
Password: testing123
Authorization
You can craft the HTTP GET request using a tool such as Fiddler and then use this request in your own custom solution.
- You cannot pass the username and password in via the URL or access the feed through a browser.
- The outgoing HTTP GET request header must contain the Basic Authorization key-value.
For example:
User-Agent: Fiddler
Host: test.test.com
Connection: keep-alive
Authorization: Basic ZmVlALCzABI6VEKABCDzdHIzM3I=
Cache-Control: no-cache
En una Mac, ¿qué solución o programa puedo usar para obtener este archivo? Intenté crear una solicitud wget pero no puedo hacerla funcionar. Fiddler no parece estar disponible en Mac.
Respuesta1
Este es un caso sencillo de resolver. Con Wget:
wget --user=testx --password=testing123 --auth-no-challenge example.com
crea la siguiente solicitud HTTP:
GET / HTTP/1.1
User-Agent: Wget/1.16.3.42-5666-dirty (linux-gnu)
Accept: */*
Accept-Encoding: identity
Authorization: Basic dGVzdHg6dGVzdGluZzEyMw==
Host: example.com
Connection: Keep-Alive
Esto se parece mucho a lo que estabas pidiendo.