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)
- Do I need to mention the coroutine dispatcher while working with Retrofit?
- converter-kotlinx-serialization artifact is missing HOT 2
- Better support for redirects in Response class HOT 3
- java.util
- Retrofit ignores a moshi JsonAdapter
- How to send GET Request with JSON body? HOT 3
- How to hide sensitive information from response header? HOT 3
- [Android 14]{less than 14 i know how to do that}Can somebody here help me with how to pick file from file picker and then convert that to byte array and send it with retrofit post request . HOT 1
- JDK test tasks do not have dependencies set up correctly
- [Bug?] When the http request executes finished. The coroutine scope still alive. HOT 1
- Feature Request - Upgrade to okhttp3 version 4.x.y HOT 1
- Security issue: Information Exposure HOT 1
- Getting message as empty when response is not successful HOT 1
- Hi,Will there be a release version? HOT 1
- Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.5.1. HOT 2
- retrofit2.adapter.rxjava2.HttpException at BodyObservable.java:54 HOT 1
- Object cannot be cast to class retrofit2.ServiceMethod HOT 1
- Exception on api calling with Okhttp HOT 1
- ./> The first request to any backend takes as long as the connectTimeout is defined (5 seconds). Any subsequent calls go then really fast. Why is the first call waiting until the timeout exceeds before it succeeds?
- Unable to build project 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.