GET HTTP request payload

前端 未结 4 1718
感情败类
感情败类 2020-12-16 14:48

I am designing an API and I wonder if it is fine to send a JSON payload on a GET request?

In this other question Payloads of HTTP Request Methods, we can find accord

4条回答
  •  渐次进展
    2020-12-16 15:46

    Also see: HTTP GET with request body - for more detail on this.

    The gist is: Yes you can, but you probably shouldn't for various reasons, including:

    • You're likely ignoring HTTP spec recommendations (you probably want to POST)
    • You may introduce caching issues
    • This is not intuitive as far as REST APIs go

提交回复
热议问题