Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Add a request factory based on okhttpclient #12

Closed
wants to merge 3 commits into from

Conversation

stephanenicolas
Copy link
Contributor

Add a request factory based on okhttpclient if okhttpclient is available on the classpath. #10

This pull requests add very little code and provides an okhttp based implementation of spring android. This http engine has several advantages :

  • SPDY support allows all requests to the same host to share a socket.
  • Connection pooling reduces request latency (if SPDY isn’t available).
  • Transparent GZIP shrinks download sizes.
  • Response caching avoids the network completely for repeat requests.

The pull requests is simple and is tested (thx to your tests).

I also updated the android maven plugin version to get things working with latest android SDK.

@royclarkson
Copy link
Contributor

Duplicate of ANDROID-138. Thanks for the pull request!

@royclarkson
Copy link
Contributor

@stephanenicolas have you signed the contributor agreement? I need this before I can accept code contribution. Thanks!

@stephanenicolas
Copy link
Contributor Author

I can' sign, your link is down. Do you have the txt that I should sign and
send you by mail ?
Or tell me what I should write here, but really I often contribute to OSS
and there is no trouble at all, take this code, I will be happy about it :)
steffdotnicolas atgmaildotcom

S.

2014-08-05 3:27 GMT-07:00 Roy Clarkson notifications@github.com:

@stephanenicolas https://github.com/stephanenicolas have you signed the contributor
agreement https://support.springsource.com/spring_committer_signup? I
need this before I can accept code contribution. Thanks!


Reply to this email directly or view it on GitHub
#12 (comment)
.

@royclarkson
Copy link
Contributor

Hmm. That's strange, but it appears some of our internal people are looking into it already. For legal reasons, we have to use that form. But once you submit it, it's good forever and you can contribute to any of Spring's projects. I'll reply when it's working again.

@stephanenicolas
Copy link
Contributor Author

Thanks Roy. Waiting for it.

S.
Le 2014-08-05 04:52, "Roy Clarkson" notifications@github.com a écrit :

Hmm. That's strange, but it appears some of our internal people are
looking into it already. For legal reasons, we have to use that form. But
once you submit it, it's good forever and you can contribute to any of
Spring's projects. I'll reply when it's working again.


Reply to this email directly or view it on GitHub
#12 (comment)
.

@royclarkson
Copy link
Contributor

It appears the page is once again available. Thanks for your patience.

@stephanenicolas
Copy link
Contributor Author

Signed (#88520140805074516)

Stéphane

2014-08-05 7:39 GMT-07:00 Roy Clarkson notifications@github.com:

It appears the page is once again available. Thanks for your patience.


Reply to this email directly or view it on GitHub
#12 (comment)
.

@royclarkson
Copy link
Contributor

Ok, thanks! I received a corresponding email with the details.

@stephanenicolas
Copy link
Contributor Author

My pleasure Roy. But If I may, I believe it would be more motivating for
contributors if the release cycle of Spring Android was faster. I have the
feeling to have submitted that PR almost a year ago. Things go much faster
usually on the mobile side.

Stéphane

2014-08-05 8:00 GMT-07:00 Roy Clarkson notifications@github.com:

Ok, thanks! I received a corresponding email with the details.


Reply to this email directly or view it on GitHub
#12 (comment)
.

@royclarkson
Copy link
Contributor

Yes, agreed. This project hasn't received the necessary attention over the last year. We're working to remedy that, and having active contributors would make a big difference.

@royclarkson
Copy link
Contributor

I've spent some time today working through the pull request. Take a look at this commit on my branch and let me know if you have any more feedback. I updated to OkHttp 2.0 in the process and did some formatting and cleanup. I'm concerned about creating a new OkUrlFactory each time, but I'm willing to push this version for a first iteration. I've tested on APIs 7, 8, 10, 13, 14, 15, 16, 17, 18, and 19. It fails on 7 and 8 because OkHttp isn't supported on those.

@royclarkson
Copy link
Contributor

I forgot to mention that I removed OkHttp as the default. I'd like to get feedback on its usage before making that change. But ultimately, I think it's probably the right move.

@royclarkson
Copy link
Contributor

I've merged my modifications of your pull request into master. Thanks, Stéphane!

See commit 0e695e2bbacf1d1953e62dcb68905dac6545bd87

@royclarkson royclarkson closed this Aug 8, 2014
@stephanenicolas
Copy link
Contributor Author

Hi @royclarkson , sorry for the delay. I reviewed the commit and it works fine for me. Thx to have merged this into Spring Android.

@clemp6r
Copy link

clemp6r commented Feb 19, 2015

See #24 about a problem with the current implementation of OkHttp factory (interceptors)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants