Comments (10)
Interesting suggestion. My initial reaction is "I love it!" but I'll have to think on it a bit more. We generally like small, purpose-built libraries and this could potentially introduce a bit of scope creep into Retrofit. I have a local branch which aims to tear out the Apache HttpClient-specific things from the core of the library which may actually aid in making this a lot easier. Perhaps it will be best to revisit this once that branch lands (hopefully before the new year).
from retrofit.
I understand. Actually, this is a question for us with RoboSpice as well. We add new libraries as extensions of RoboSpice to build proofs of concepts and try new technologies, but our core remains quite stable now. Indeed, we think of extensions as "samples" but it gave some users the feeling that our library is becoming a five-headed beast.
I would be interested to see how you deal with this kind of complexity if you go in the direction of the feature I suggested.
I am building a new extension of RoboSpice to integrate Retrofit and hope to publish it by the end of the year as well.
from retrofit.
@JakeWharton and other team members. If you are interested, I just added a retrofit module with tests and samples to RoboSpice. This module offers to execute retrofit http requests inside an android service and use file caching transparently for annotated JSON-POJOs.
Caching uses the same Gson mechanism as Retrofit converters.
We would be interested to get notified of the first release of Retrofit on maven central so that people can start using the Retrofit module of RoboSpice.
Sample :
https://github.com/octo-online/robospice/tree/master/samples/robospice-sample-retrofit
Extension module for Retrofit + tests :
https://github.com/octo-online/robospice/tree/master/extensions/robospice-retrofit-parent
We would be glad to get associated to Retrofit for its first release.
Would you also be interested in some contributions, for instance to provider jackson 1 & 2 converters ?
from retrofit.
We definitely do not want converters built-in for other serialization types or libraries. If the user of the library is smart enough to know they need something else then they should be able to implement it with reasonable simplicity. We want to provide the minimum viable configuration by default for use so that Retrofit is usable out-of-the-box. Providing a million configuration options and requiring the user to make a ton of decisions up front will turn most people off.
from retrofit.
An approach to medidate on for us... ;)
Do you have any plan for releasing at least a snapshot of retrofit soon ?
from retrofit.
+1 @stephanenicolas is it going to be released soon on maven central or something?
from retrofit.
my 2p is that an attractive aspect of retrofit is the lack of modularity wrt http engine or serialization engines. It ends up being far less code, special arbitrary portability words, hooks, etc. leading to a quicker grok. plugin models tend to end up with distance between each supported thing which can lead to reliability cliffs.
All that said, I'm torn :)
I don't like HttpURLConnection, but I don't like forcing an apache dep either. HttpURLConnection sucks in old jres particularly, but those places are fairly well known, etc. I'd help maintain HttpURLConnection if there was interest in adding or switching to that.
from retrofit.
heh of course you do already have what I want :) https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit/http/client/UrlConnectionClient.java
nm
from retrofit.
HttpUrlConnection is supported on Android for 2.3 and newer and on the JVM by default.
from retrofit.
@stephanenicolas While I think providing the parsing of annotations would be useful, I think the value in Retrofit is abstraction behind interfaces. The annotations are metadata on top of method declared on an interface. You shouldn't require the annotation metadata in order to provide alternate class implementations of your APIs. In fact, we do this heavily at Square. All of our apps can run in what we call "mock mode" where fake class that implement our API interfaces return example data. We can use 100% of both Square Wallet and Square Register in this mode for testing and development purposes.
from retrofit.
Related Issues (20)
- UndeliverableException with RxJava3 and Retrofit2 HOT 1
- Unable to create @Body converter for java.util.Map<java.lang.String, java.lang.Object> when using kotlinx.serialization Converter HOT 1
- Jackson dependency version breaks Android 21+ minimum contract HOT 2
- UnknownHostException in V 2.9.0 HOT 4
- Set logging interceptor based on API HOT 1
- Retrofit + Kotlin coroutines : get info of actual Java exception instead of just kotlin.Unit HOT 2
- HttpException can't be initialized HOT 1
- Allow request body converters to access the request body mediatype HOT 5
- Does adding ProGuard rules for Okio still require in 2.11.0? HOT 1
- How to keep generic type of paramters? HOT 1
- How to get the URL endpoint and the GET/POST method when an Exception occurs? HOT 2
- KSP support for retrofit-response-type-keeper HOT 4
- kotlin.coroutines.Continuation issue, maybe just error on graalvm HOT 2
- GsonConverterFactory not able to access in Android release build HOT 3
- Last segment of request url is truncated when executing PUT with @Path and @Body parameter HOT 1
- [Feature Request]Header support in Converter HOT 1
- java.lang.IllegalArgumentException: Parameter type must not include a type variable or wildcard: java.util.List<MyModel> (parameter #5) for method ApiService.myRequest HOT 1
- Okhttp vulnerabilities HOT 1
- Retrofit Kotlin examples
- Changing default dispatchers used during suspend calls of Retrofit with test dispatchers. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retrofit.