title: Converting curl command to AJAX
body: <p>I have an API that I need to use but I'm not sure how to input my curl command through AJAX. Any help would be appreciated.</p>
  
  <p>My curl command: <code>curl -H “Authorization: Token #{auth_token}” -X GET http://localhost:3000/api/v1/baskets/</code></p>
  
  <p>AJAX so far:</p>
  
  <pre><code>$.ajax({
      url: "http://localhost:3000/api/v1/baskets/",
      type: 'POST',
      dataType: 'json',
      contentType: 'application/json',
      processData: false,
      success: function (data) {
        alert(JSON.stringify(data));
      },
      error: function(){
        alert("Cannot get data");
      }
  });
  </code></pre>
  
  <p>UPDATE: Problem 1 is fixed. I was able to do similar methods to come up with the results I needed except for this last API call. I'm having trouble getting thing everything after -d except for the website.
  Curl command: <code>curl -H “Authorization: Token #{auth_token}” -X GET -d ‘basket_id=#{basket_id}&amp;price=#{price}&amp;title=#{title}&amp;merchant_url=#{merchant_url}&amp;comment=#{comment}&amp;product_url=#{product_url}&amp;merchant_name=#{merchant_name}&amp;color=#{color}&amp;size=#{size}&amp;product_image_url=#{product_image_url}’ http://localhost:3000/api/v1/baskets/add</code></p>
  
  <p>AJAX so far:</p>
  
  <pre><code>     $.ajax({
      url: "http://localhost:3000/api/v1/baskets/add",
      type: 'GET',
      processData: false,
      headers: { 'Authorization' : giftibly_token_string },
       data: {"basket_id": "2", "title" : "Hello There", "merchant_name" : "Target", "merchant_URL" : "http://test.com", "product_url" : "http://test.com/product" },
      success: function (data) {
        window.response = JSON.stringify(data);
        console.log(response);
      },
      error: function(){
       console.log("Cannot get data");
      }
  });
  </code></pre>
  
  <p>Browser result: <code>{"response":"Missing attributes: Basket ID, Title, Merchant Name, Merchant URL, Product URL"}</code></p>