1

I am currently facing a requirement that could support HTTP Get Request with payload. Also this question has confused me for a long time. Is there a way to send body with a HTTP GET request from browser side? I know you could send get request with body by using Python, Php,cUrl etcs, but how about from browser side?

I have done some investigations on this topic and find out that most of the popular http request libaries such as axios,request,superagent do not support this feature. Even, the fetch and XMLHTTPrequest does not support Get method with payload.(https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)
The weird thing is that the standard(or RFCs) did not forbid sending a get request with body.
Here comes my question, is there any way from web browser we could support http get request with body?

Osito Wang
  • 43
  • 4
  • 1
    Check this link https://stackoverflow.com/questions/978061/http-get-with-request-body – Dariel Ramos Díaz de Villegas Sep 10 '19 at 22:01
  • @DarielRamosDíazdeVillegas I have read through this post before. It does not solve my problem. Check this link: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send. It explicitly set request body to null if it is a GET. As `XMLHttprequest` is the low-level implementation for sending request. If this is not possible, how could I send out get with body from browser. – Osito Wang Sep 11 '19 at 00:06

0 Answers0