1
나는 간단한 각도 응용 프로그램을 가지고 있습니다. 간단한 인증 방법이 있습니다. 메서드가 Internet Explorer에서 실행될 때 WCF 메서드는 데이터와 함께 인수를받습니다. ame 코드가 firefox에서 실행되면 인수는 서버에서 null입니다.
$http({
url: Url,
method: "POST",
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
data: AuthenticateRequest
});
WCF 방법
[WebInvoke(RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
Method = "*",
BodyStyle = WebMessageBodyStyle.Bare)]
[OperationContract]
AuthenticateResponse Authenticate(AuthenticateRequest AuthenticateRequest);
피들러 IE 정보
POST http://www.api.com:56586/V1/Service.svc/json/Authenticate HTTP/1.1
X-Requested-With: XMLHttpRequest
Accept: application/json, text/plain, */*
Content-Type: application/json; charset=utf-8
Referer: http://www.api.com:54567/
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko
Host: localhost:56586
Content-Length: 45
DNT: 1
Connection: Keep-Alive
Pragma: no-cache
{"UserName":"username","Password":"password"}
파이어 폭스 피들러 정보
OPTIONS http://www.api.com:56586/V1/Service.svc/json/Authenticate HTTP/1.1
Host: www.api.com:56586
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Origin: http://www.api.com:54567
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-requested-with
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
FF가'POST '대신'OPTIONS' 요청을 보냅니다. 따라서 페이로드를 얻지 못합니다. 웹 응용 프로그램과 웹 서비스를 동일한 호스트/포트에서 호스팅합니까? 브라우저 자바 스크립트 콘솔에 어떤 정보가 있습니까? – Sebastian