Javascript (または ajax または jquery) を使用して REST Api を呼び出すにはどうすればよいですか?
curl -v -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -X PUT --user user:password http://url -d "{\"name\": \"Marcus0.2\",\"start\": 1361381326000,\"end\": 1361640526000}"
これを使用可能な ajax 呼び出しに変換する助けが必要です。ありがとう
$.ajax({
type: 'put',
url: 'https://this.is.my/url',
dataType: 'json',
data: { \"name\": \"Marcus0.3\" , \"start\": 500000 , \"end\": 1361640526000 }
});
このコードは機能しません [理由は不明]。また、「https://this.is.my/url」は、オンラインで投稿したくない長い URL の略です。