안녕하세요, 저는 백엔드에 전화를 걸어 포스트 메서드를 호출하는 것과 같은 이상한 문제를 일으키려고합니다.
Remote Address:192.168.58.183:80 Request URL:http://192.168.58.183/ESService/ESService.svc/CreateNewAccount Request Method:OPTIONS Status Code:405 Method Not Allowed Request Headersview source Accept:*/* Accept-Encoding:gzip, deflate, sdch Accept-Language:en-US,en;q=0.8,pl;q=0.6 Access-Control-Request-Headers:accept, content-type Access-Control-Request-Method:POST Connection:keep-alive Host:192.168.58.183 Origin:http://localhost:8100 Referer:http://localhost:8100/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) > AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36 Response Headersview source Access-Control-Allow-Headers:Content-Type, Accept Access-Control-Allow-Methods:POST,GET,OPTIONS Access-Control-Allow-Origin:* Access-Control-Max-Age:1728000 Allow:POST Content-Length:1565 Content-Type:text/html; charset=UTF-8 Date:Mon, 02 Feb 2015 09:11:17 GMT Server:Microsoft-IIS/7.5 X-Powered-By:ASP.NET
그리고 내 코드는 여기처럼 보인다 난이 호출이 누군가를 검토 할 수 있습니다 괜찮 생각하십니까?
$scope.RegisterUser = function(){
var us = {
UserName:$scope.userName,
Password:$scope.password,
UserRoleID:null,
Company:$scope.company,
Terms:$scope.terms,
ID:null,
BuyerID:app.buyerId
};
$http({method:'POST', url:app.wcf + '/CreateNewAccount', data:{us:us}})
.then(
function(resp){
app.Logger(resp.data);
},
function(err){
app.Logger(err);
})};
그래서 어쩌면 내가 뭔가를 잘못하고 있어요 아니면 HTTP에 옵션 설정을 통과해야합니까?
어떻게 문제를 해결 했습니까? –
나는 백엔드에서 허용한다고 생각한다. – vivid