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