Sending data with Retrofit

Sending data with Retrofit

Need to hire an app developer?

Post your project

in 5 minutes for free

Jaenelle Isidro

Re: Sending data with Retrofit

on Android Developers at Jan 09, 2018 18:30

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

Re: Sending data with Retrofit

on Android Developers at Jan 09, 2018 18:33

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."
This forum thread discusses Sending data with Retrofit. You can join the discussion by clicking on 'Post a reply'. If you are new to Android Developers Forum, you will need to sign up and create a new account.

Sending data with Retrofit related posts on Android Developers Forum

Secure your Android App with Fingerprints

by Mobulous on Android Developers

Google has now included one more secured feature in Android smartphone. Presently the User will also have the unique mark checking support on their gadget and ensure they are securing their own information and data from ...

Scanning APs

by Sheridan on Android Developers

Hi, I did read a lot about how to scan Access Points (APs) and I learned that I need to register the receiver. I did this as well. However, still the code cannot scan the AP and I am not sure why (i.e., I placed some bre...
We have just finished developing a type of chatting app for iOS & Android. There are 4 sounds fx - sent/received message and sent/received chat message. In iOS all sounds are fine, however in Android the sent & receive...

SKRWT available for Android devices now

by montse on Android Developers

SKRWT, an image corrector by Perspective, will help you get better photos by correcting the short focal length of your phone. Check the app now available for Android, http://www.androidpolice.com/2016/01/14/perspective-...
Reply on this threadPost a reply
Loading...
Advertisement