How do I make a call to a REST Api with Javascript (or ajax or jquery)?
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}"
I need help converting this to a useable ajax call. Thanks
$.ajax({
type: 'put',
url: 'https://this.is.my/url',
dataType: 'json',
data: { \"name\": \"Marcus0.3\" , \"start\": 500000 , \"end\": 1361640526000 }
});
This code does not work [not sure why]. Also, 'https://this.is.my/url' is just short for the longer url, which I don't want to post online