I use jQuery Ajax to send data to server. I set post type as POST but data always get send using GET method. How to send data using Post method?
$.ajax({
type: "POST",
dataType: 'jsonp',
url: 'http://do.convertapi.com/Web2Image/json/',
data: {
'CUrl':$('#txtUrl').val(),
'OutputFormat':'png',
'PageWidth':600,
'ApiKey':apiKey
},
jsonp: "callback",
success: function (data) {
if (data.Result)
{
$('#imgSnapShot').attr('src','data:image/png;base64,'+data.File);
$('#dvStatus').text("Converted successfully!");
}
else {
$('#dvStatus').text("Error: " + data.Error);
}
},
});
As Graham Clark posted, jsonp Ajax requests are always posted as GET. If I remove jsonp option I get another problem, cross domain posting error. Is there any solution for my problem?