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

前端 未结 23 2353
面向向阳花
面向向阳花 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:40

    I tried this: When you are creating your Retrofit instance, add this converter factory to the retrofit builder:

    gsonBuilder = new GsonBuilder().serializeNulls()     
    your_retrofit_instance = Retrofit.Builder().addConverterFactory( GsonConverterFactory.create( gsonBuilder.create() ) )
    

提交回复
热议问题