Go to the website: JSON Schema 2 POJO
Paste your Json format and then
Select source type: JSON, annotation style: none
Create a POJO class, for example, your class name: MyPOJOClass
Then in your Api:
@POST("endpoint") public Call<Void> postArray(@Body MyPOJOClass mypojoclass);
If you have headers, you can add them to such parameters:
@Header("Accept") String accept,@Header("Content-Type") String contentType
@Edit: for your recall review my answer is: how-to-use-gson-2-0-on-onresponse-from-retrofit-2-0
Yasin Kaรงmaz
source share