How to POST raw whole JSON in the body of a Retrofit request?

前端 未结 23 2338
面向向阳花
面向向阳花 2020-11-22 00:57

This question may have been asked before but no it was not definitively answered. How exactly does one post raw whole JSON inside the body of a Retrofit request?

See

23条回答
  •  北海茫月
    2020-11-22 01:37

    Instead of classes we can also directly use the HashMap to send body parameters for example

    interface Foo {
      @POST("/jayson")
      FooResponse postJson(@Body HashMap body);
    }
    

提交回复
热议问题