REST에서 웹 서비스의 html + javascript 부분을 수행하려고합니다.OPTIONS XMLHTTPRequest에서 PUT 대신에 요청
<!DOCTYPE html>
<html lang="en"
<script type="text/javascript">
function testPut(url){
var xhr = new XMLHttpRequest();
xhr.open('PUT', url, false);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.send(null);
}
</script>
<body>
<form name="test" action="">
<input type="button" value="Lanceur" onclick="testPut('http://fake.es:8080')" />
</form>
</body>
</html>
하지만 대신에 PUT의 옵션지고 (web.py으로 수행) 웹 서버에서 :
111.111.111.111:52014 - - [15/May/2013 17:01:47] "HTTP/1.1 OPTIONS /" - 200 OK
내가 그것을 어떻게 해결 사기를 예제로이 코드? OPTIONS 요청을 제거하고 PUT 만 보내시겠습니까?
비슷한 질문 (here) [http://stackoverflow.com/q/8153832/57091]. – robsch