Summary :
Want to send data to another domain using POST method to JSONP.
Code :
$http.jsonp($scope.baseApiUrl+'QueryBuilder/getData?callback=JSON_CALLBACK')
.success(function(data, status, headers, config) {
$scope.success = true;
console.log(data);
}).error(function (data, status, headers, config) {
$scope.error = true;
});
Its working fine. But I have alot of data that I need to send to the service, cross domain, and it is too large to send via the querystring. So i want to send it as JSON.
data: {
"dbName":"test",
"tables":["city","persons"],
"filters":["city_id='Hyd'"]
}
Findings :
How to make a jsonp POST request that specifies contentType with jQuery?
Unable to post data using JSONP on Cross Domain
How to send data using JSONP from localhost to domain.com
Using PUT/POST/DELETE with JSONP and jQuery
Every post shows that it is not possible.so is there any alternate way to do this ?
Question :
Is it possible to post data to JSONP? Or does all data have to be passed in the querystring as a GET request?
Any immediate help will be highly appreciable. Thanks.