I am trying to make request to delete comment via Instagram API. This is my code:
$.ajax({
type: "POST",
url: "https://api.instagram.com/v1/media/" + mediaId + "/comments/" + commentId + "?access_token=" + accessToken,
data: { _method: "DELETE" },
success: function(result){
...
}
});
But I get this two errors:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://timetoplay.alexjcomp.lclients.ru' is therefore not allowed access. The response had HTTP status code 400.
Status Code:400 BAD REQUEST
First is from console and second from network tab in chrome.
As I understand my problem is that I can not make CORS Post request. With CORS GET request everything was just fine because I used dataType: "jsonp"
. How can I fix it in this case?