
Estou tentando baixar um arquivo no meu Mac, mas os requisitos para obtê-lo são muito rígidos:
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
Em um Mac, qual solução ou programa posso usar para obter esse arquivo. Tentei criar uma solicitação wget, mas não consigo fazê-la funcionar. O Fiddler não parece estar disponível no Mac.
Responder1
Este é um caso simples de resolver. Com Wget:
wget --user=testx --password=testing123 --auth-no-challenge example.com
cria a seguinte solicitação 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
Isso se parece muito com o que você estava pedindo.