내 $ http.POST에 대한 각도 1.5()를 사용하고 모든 것이 잘 작동하지만이 오류가 계속 :로컬 호스트 및 원격위한 IIS 8.x의에 PUT 이상 POST를 허용하는 방법
을**GENERAL**
Request URL:http://localhost/ThingBlu/OmniGrow/js/json/logged-users.json
Request Method:POST
Status Code:405 Method Not Allowed
Remote Address:[::1]:80
**Response Headers**
Allow:GET, HEAD, OPTIONS, TRACE
Cache-Control:private
Content-Length:5448
Content-Type:text/html; charset=utf-8
Date:Sun, 11 Sep 2016 18:08:27 GMT
Server:Microsoft-IIS/10.0
X-Powered-By:ASP.NET
**Request Headers**
Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8
Authorization:Basic OWFjMTIwMTAtNjhmZC00YTY4LWIxMTQtMTI3NjcyYmRkMmNkOjRmOGJkMDg0LTY2NDQtNDVmMi1iNGI4LWI4OTgwNzgyMDkzZA==
Connection:keep-alive
Content-Length:305
Content-Type:application/json;charset=UTF-8
Cookie:XDEBUG_SESSION=XDEBUG_ECLIPSE; ASPSESSIONIDQARBBSBC=LGJPEMMBPPMIKGAEMPOKDDKP; ASPSESSIONIDQAQBBRDC=HNLHMCECDLFMFBMOFMNFNNEA; ASPSESSIONIDSARCBSBD=DMGPJIECDOKINIEIIADELBOG; ASPSESSIONIDSCQBCQCD=HHHNEBHCACCJABGNFAMFHNAD; ASPSESSIONIDQATBARBD=KFNLJLHCMOECJOMCDDOFBINL; ASPSESSIONIDQCSABTAC=GDGJMOMCNPDBJAAOKJJHDDGH
DNT:1
Host:localhost
Origin:http://localhost
Referer:http://localhost/ThingBlu/OmniGrow/index.html
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36
가 여기에 문제의 :
내 WebConfig 파일은 다음과 같습니다 나는 아래의 코드를 단계별로, 그리고 특정 부분에 충돌 할 때마다 무슨 일
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
은, 위의 오류가 발생합니다.
로컬 JSON 파일에 편지를 쓰고 있는데, Frontier Communications에서 일했을 때 성공했습니다. 그것이 불가능하다는 것을 대부분의 게시물의 억울함에 매우 가능합니다. 나는 그것을했고, FRONTIER와 T-MOBILE도 그렇다. 말했다되는 것으로, 여기 내 ANGULAR 코드입니다 :
/**
* Then log the person in
* @returns {object through promises}
*/
ctrlLogin.fetchLogin = function() {
//SUBMIT FORM
$scope.submit = function() {
console.log('Submit Clicked');
//Encode Password if FormData is VALID
if ($scope.formData) {
formObj = {
uid: $scope.formData.myusername,
pwd: $scope.encode64($scope.formData.mypassword),
rmbr: $scope.formData.rememberme
};
//Login Data
loginData.svc.getLoginData(formObj).then(function (result) {
console.log("Login message: ", result);
//if success send the person through
if (result.data.message === "failure") {
console.log("ERROR: ", result.data.message);
$scope.changeRoute("/error");
} else {
console.log("SUCCESS: ", result.data);
//Get Path to JSON
$http.get(SVCURLS.data.loggedusers).then(function (data) {
//SUCCESS so therefore pass ACTIVE = 1 for DASHBOARD as that's
//where we're going next.
if (appservice.appFuncs.saveToJson(result.data, 1)) {
data.users = angular.toJson(result.data);
//use $.param JQUERY function to serialize the data from JSON
$scope.users = $.param(data.users);
//CONFIG using HEADERS
var config = HEADERS.tokenheaders;
**//NOTE: THIS IS THE POINT AT WHICH THE 405 ERROR OCCURS**
$http.post(SVCURLS.data.loggedusers, data.users, status, config)
.success(function (data, status, headers, config) {
//SUCCESS CALBACK
$scope.PostDataResponse = data;
console.log("SUCCESS Writing to JSON FILE!");
window.location.href = "main-page.html";
})
.error(function (data, status, headers, config) {
//FAILURE CALLBACK
$scope.PostDataResponse = "DATA: " + data +
"<hr/>Status: " + status +
"<hr/>Headers: " + headers +
"<hr/>Config: " + config;
console.log("ERROR Writing to JSON FILE");
return deferred.reject(data ? data : '[NO DATA]');
});
} else {
//ERROR show what happened
console.log("ERROR: ", data);
//Now flip the pages that the session has been
//Created
$scope.msg = "There was an error saving your information.";
deferred.reject(data ? data : '[NO DATA]');
}
});
}
});
}
return "intial load";
};
};
ctrlLogin.fetchLogin();
도움이 많이 주시면 감사하겠습니다. 고맙습니다.