JSON vs Form POST

前端 未结 3 693
孤街浪徒
孤街浪徒 2020-12-28 13:25

We\'re having a bit of a discussion on the subject of posting data to a REST endpoint. Since the objects are quite complex, the easiest solution is to simply serialize them

3条回答
  •  暖寄归人
    2020-12-28 13:59

    I'd say that both methods will work well it's important that you stay consistent across your APIs. The option I would personally choose is simply sending the content as application/json.

    POST doesn't force you to use application/x-www-form-urlencoded - it's simply something that's used a lot because it's what webbrowsers use.

提交回复
热议问题