2
기본 인증 헤더가 필요한 웹 서비스가 있습니다. 그러나, 나는리디렉션을 통한 기본 인증
var header = "Authorization: Basic " +
CreateBasicHttpAuthenticationHeader(login, password);
webRequest.Headers.Add(header);
var webResponse = (HttpWebResponse)webRequest.GetResponse();
를 사용하여 호출 할 때 그것은 303 반환 - 기타 참조 :
POST https://myservice/rates HTTP/1.1
Authorization: Basic QXZ...NjY=
Content-Type: application/x-content
X-API-Version: 1.1
If-Unmodified-Since: Mon, 23 Sep 2013 08:32:27 GMT
User-Agent: UserAgent
응답 :
HTTP/1.1 303 See Other
Date: Mon, 23 Sep 2013 08:30:57 GMT
X-Opaque-ID: q8nxxxxc
Location: https://myservice/rates
Content-Length: 0
닷넷이 자동으로 새 위치에 GET 요청을 전송 :
GET https://myservice/rates HTTP/1.1
Content-Type: application/x-content
X-API-Version: 1.1
If-Unmodified-Since: Mon, 23 Sep 2013 08:32:27 GMT
User-Agent: UserAgent
그러나 이번에는 Authorization 헤더를 보내지 않습니다. 모든 통화에서 모든 헤더를 보내도록 알리는 방법을 알고 있습니까? 내용을 따르지 말라고해야합니까?