
그래서 Mac에서 파일을 다운로드하려고 하는데 파일을 얻기 위한 요구 사항이 매우 엄격합니다.
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
Mac에서 이 파일을 얻으려면 어떤 솔루션이나 프로그램을 사용할 수 있습니까? wget 요청을 작성해 보았지만 제대로 작동하지 않습니다. Mac에서는 Fiddler를 사용할 수 없는 것 같습니다.
답변1
이것은 해결하기 쉬운 간단한 사례입니다. Wget 사용:
wget --user=testx --password=testing123 --auth-no-challenge example.com
다음 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
이것은 당신이 요구한 것과 거의 비슷해 보입니다.