title: Sending a http request through AJAX
body: <p>I have an SMS API that I need to use to send a text message on a site that I'm building. There is a form on the website that collects a few details and the phone number, the message has to go to the phone number specified in the form.</p>
  
  <p>The API link I have is:</p>
  
  <blockquote>
    <p><a href="http://URL/api/v3/?method=sms&amp;api_key=XXd9e5XXXXXXXXXXXXX&amp;to=197XXXXXXX&amp;sender=INFXXX&amp;message=Welcome%20to%20messaging" rel="nofollow">http://URL/api/v3/?method=sms&amp;api_key=XXd9e5XXXXXXXXXXXXX&amp;to=197XXXXXXX&amp;sender=INFXXX&amp;message=Welcome%20to%20messaging</a></p>
  </blockquote>
  
  <p>How can I do this POST request using Ajax?</p>
  
  <pre><code>var formData = {
      'name': name,
      'location': location,
      'mobile': mobile
  };
  $.ajax({
      type: 'POST',
      url: 'upload.php',
      data: formData,
      dataType: 'json',
      encode: true
  })
  </code></pre>
  
  <p>This is what I use with the form on the site, can I use the same with this API?</p>