I trying to do the html+javascript part of a web service in REST. With this code as example:
<!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>
But in the web server (done with web.py) I getting OPTIONS instead of PUT:
111.111.111.111:52014 - - [15/May/2013 17:01:47] "HTTP/1.1 OPTIONS /" - 200 OK
How con I solve it? To remove the OPTIONS request and only send a PUT?