Sending data with Retrofit
Android App Developers

Sending data with Retrofit

Read the Sending data with Retrofit thread within the Android App Developers forum. You can reply to this post and participate in this discussion on the AppFutura mobile app development forum.
Need to hire an app developer?
Post your project
in 5 minutes for free
This is the Android app development forum. Pick one of the following Android app development topics and participate. You can also start your own Android app development discussion.
Jaenelle Isidro
 
Posts: 7

Re: Sending data with Retrofit

on Android App Developers Forum at Tue Jan 09, 2018 6:30 pm

JakeWharton commented on Jan 29, 2016
Retrofit is not going to implement this, because it's basically a pathway to becoming our own object serializer which is not something that we want to embed. Even a simple version of this would quickly devolve into the large mechanics needed for proper serialization customization. We already border on that with just the parameters and return type.

That said, there's one pathway to doing this yourself currently and one that will be added in the future:

The first is by registering a Converter.Factory which provides a stringConverter for these types. It would need to be used with @Query(encoded=true) so that things like & work properly in the final URL.

The second is with #626 which will allow custom hookups of annotations to the underlying RequestBuilder. This will allow you to create @QueryObject which actually calls addQueryParam directly for each field. This is a post-2.0 feature, however.

https://github.com/square/retrofit/issues/1503
Jaenelle Isidro
 
Posts: 7

Re: Sending data with Retrofit

on Android App Developers Forum at Tue Jan 09, 2018 6:33 pm

did you try this?
https://github.com/square/retrofit/issues/1503

according to the author of retrofit,

"That said, there's one pathway to doing this yourself currently and one that will be added in the future:

The first is by registering a Converter.Factory which provides a stringConverter for these types. It would need to be used with @Query(encoded=true) so that things like & work properly in the final URL.

The second is with #626 which will allow custom hookups of annotations to the underlying RequestBuilder. This will allow you to create @QueryObject which actually calls addQueryParam directly for each field. This is a post-2.0 feature, however."
Return to Android App Developers