title: how to post a like or delete an instagram like using instagram api?
body: <p>hi all could any one tell me how i can post a like and delete an instagram like using api?
  i tried to delete a like using this code but i dont get any response from ajax call. could any one tell me what i am doing wrong here ?is this possible doing php ?how?</p>
  
  <p>xxxxxxxxxxxxxxxxxx_xxxxxxxx ==> Media-Id such as: 23424343243243_2343243243</p>
  
  <p><a href="http://instagram.com/developer/endpoints/likes/#delete_likes%22test%22" rel="nofollow">Instagram API Docs for Deleting Like</a></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  function deleteLike() {
  
  alert("inside function");
  
      var url = "https://api.instagram.com/v1/media/xxxxxxxxxxxxxxxxxx_xxxxxxxx/likes?access_token=XXXX";
      $.post(url, {
          "method": "delete",
      }, function(data) 
         {
           var ajaxResponse = data;
  
            alert("success"+ajaxResponse);
  
      })
      }
  
  &lt;/script&gt;
  &lt;/head&gt;
    &lt;body onload="deleteLike();"&gt;
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Edited:cross domain php curl:(but how to tell it if this is post method or delete method?"</p>
  
  <pre><code>$url = "https://api.instagram.com/v1/media/xxxxxxxxxxxxxxxxxx_xxxxxxxx/likes?access_token=XXXX";
  
          $api_response = get_data(''.$url);
          $record = json_decode($api_response); // JSON decode 
  
  
  
  /* gets the data from a URL */
  function get_data($url) {
      $ch = curl_init();
      $timeout = 5;
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
      $data = curl_exec($ch);
      curl_close($ch);
      return $data;
  }
  </code></pre>