Can someone help me with making a call to a REST API using JavaScript, 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'm looking to convert the above code snippet into a functional Ajax call. Thank you for any assistance.
$.ajax({
type: 'put',
url: 'https://this.is.my/url',
dataType: 'json',
data: { \"name\": \"Marcus0.3\" , \"start\": 500000 , \"end\": 1361640526000 }
});
The provided Ajax code is not working as expected [reason unknown]. Additionally, '' represents a shortened version of the actual URL which I prefer not to disclose online.