$http.get() with JSON data

前端 未结 1 1342
春和景丽
春和景丽 2021-02-19 23:47

I\'m writing a server app and wanted the client to use data in body to pararmeterize my GET method, like this:

# http -v GET http://localhost:3000/url text=123 f         


        
相关标签:
1条回答
  • 2021-02-20 00:13

    I would take this as the answer:

    For HTTP, it's not prohibited, but you shouldn't use it as the server may (and SHOULD) ignore the body of GET request.

    Reference: HTTP GET with request body

    For XHR, body of GET and HEAD will be ignored (hinted by @jacob-koshy).

    Reference: https://xhr.spec.whatwg.org/#the-send()-method

    0 讨论(0)
提交回复
热议问题