-1

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 ?

Kamil Gareev
  • 148
  • 2
  • 12

2 Answers2

3

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.

Community
  • 1
  • 1
Felix Guo
  • 2,632
  • 12
  • 20
0

You can use XMLHttpRequest

Try this -

xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST","test.html",true);
xmlhttp.send();
Avinash T.
  • 2,150
  • 2
  • 14
  • 23