JSON vs Form POST

前端 未结 3 670
孤街浪徒
孤街浪徒 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 14:16

    There is nothing wrong about sending it directly as serialized JSON, for example google does this by default in it's volley library (which obviously is their recommended REST library for android).

    If fact, there are plenty of questions on SO about how not to use JSON, but rather perform "normal" POST requests with volley. Which is a bit counter intuitive for beginners, having to overwrite it's base class' getParams() method.

    But google having it's own REST library doing this by default, would be my indicator that it is OK.

提交回复
热议问题