Is it considered bad practice to perform HTTP POST without entity body?

后端 未结 6 874
粉色の甜心
粉色の甜心 2020-12-12 13:58

I need to invoke a process which doesn\'t require any input from the user, just a trigger. I plan to use POST /uri without a body to trigger the process. I want to know if t

6条回答
  •  伪装坚强ぢ
    2020-12-12 14:42

    Yes, it's OK to send a POST request without a body and instead use query string parameters. But be careful if your parameters contain characters that are not HTTP valid you will have to encode them.

    For example if you need to POST 'hello world' to and end point you would have to make it look like this: http://api.com?param=hello%20world

提交回复
热议问题