Is it any way to make post request without using form (I need to put pure JSON in Post body) by a browser?
It is possibly with async request, but what's about sync POST ?
Is it any way to make post request without using form (I need to put pure JSON in Post body) by a browser?
It is possibly with async request, but what's about sync POST ?
Using jQuery's .post()
function will send a post request to a page and get it's results for you.
http://api.jquery.com/jQuery.post/
It's also possible to use .ajax()
or just use pure javascript to send an Ajax request (XMLHTTPREQUEST).
http://api.jquery.com/jQuery.ajax/
Of course, if you don't want to use XML, then you can follow the answer to: JavaScript post request like a form submit, it will give you more insight on the matter.
You can use XMLHttpRequest
Try this -
xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST","test.html",true);
xmlhttp.send();