1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-15 20:56:41 +03:00
Commit Graph

32 Commits

Author SHA1 Message Date
Jake Wharton
749f4b960c WebSockets should show an empty body to interceptors. 2016-09-01 09:26:21 -04:00
jwilson
a4d3082d2f Run IntelliJ's analysis on OkHttp.
This made a few hundred suggestions, many of which are thoughtful but
I'm deliberately ignoring anyway.

The following fixes are good ideas.
2016-06-27 00:47:50 -04:00
jwilson
21d6303418 Restore no-args constructor for OkHttpClient.
This is a popular API and keeping it working is handy.
2016-01-01 15:22:14 -05:00
jwilson
38d570a6b2 Drop get and set prefixes in OkHttpClient, OkHttpClient.Builder 2016-01-01 12:12:35 -05:00
jwilson
f2461183e8 Refactor towards an OkHttpClient.Builder.
Still some work to do on method naming, but this was the interesting part.
Also very much need to rename OkUrlFactory in tests to urlFactory, otherwise
the client.client stuff becomes madness.
2016-01-01 10:55:32 -05:00
jwilson
98ae0fb92c Sort imports and wrap documentation at 100 columns.
This is a mechanical refactoring. The only thing I had trouble with is IntelliJ's
weak support for <ul> tags in Javadoc.
2015-12-23 19:34:28 -05:00
jwilson
c9a89876de Rename com.squareup.okhttp to okhttp3
Maven group changes will come in follow up.
2015-12-16 01:34:59 -05:00
Jake Wharton
f8923a4766 Deprecate the Apache shim. 2015-12-14 22:42:32 -05:00
jwilson
68e3fbb0a3 Fix some breaks calling obsolete APIs. 2015-12-13 22:39:30 -05:00
Noriyoshi Fukuzaki
9235529746 Allow an empty PUT and POST to keep compatibility
commit d36da22271054ea84b5f6a5b182042a3476696bc
Author: Noriyoshi Fukuzaki <noriyoshi.fukuzaki@kii.com>
Date:   Fri May 1 13:14:39 2015 +0900

    reverted a code formatting

commit 80c7e2da23cdc9be90ff208f609c5ba5f0a5a394
Author: Noriyoshi Fukuzaki <noriyoshi.fukuzaki@kii.com>
Date:   Sat Apr 25 21:22:43 2015 +0900

    added assertion code

commit 198f55778241f20b0e3de2f4d56e8aea38c4c934
Author: Noriyoshi Fukuzaki <noriyoshi.fukuzaki@kii.com>
Date:   Fri Apr 24 16:38:47 2015 +0900

    Allow an empty PUT and POST to keep compatibility
2015-05-10 10:56:11 -04:00
Jake Wharton
9b8ea972bf Add a test for case insensitive content type matching. 2015-04-17 10:30:39 -04:00
Noriyoshi Fukuzaki
8bce6897f9 fixed a bug that content type is compared by case sensitive 2015-04-17 15:54:10 +09:00
Neil Fuller
6ca86d4de1 Source-incompatible: ResponseBody methods throw IOException
This is a binary-compatible change, but code that currently calls
ResponseBody [contentLength()|byteStream()|source()|charStream()]
that doesn't necessarily catch or declare IOException will need
to with this change.

These methods could be performing I/O (opening streams, etc.).
Throwing IOException seems reasonable in this case.

contentType() and charset() have not been changed.
2015-01-09 15:32:24 +00:00
Jake Wharton
5355762a6f Rename play to start. 2015-01-04 23:17:42 -08:00
Jake Wharton
8b6aa0dca5 Use a Buffer for body contents. 2015-01-02 14:03:25 -08:00
Jake Wharton
15c81fdfc2 Normalize caching size in loop-local variable.
This was present in a bunch of loops, but not all and not consistently. After fixing two, I figured that I would normalize them all under the umbrella of uniformity and being lazy (only lookup up the value once if it never changes).
2014-12-24 11:33:14 -08:00
Jake Wharton
b16c9f29a8 Support overriding content type via explicit header. 2014-08-19 09:16:58 -07:00
Jesse Wilson
9fcb67db2f Rename Request.Body to RequestBody and Response.Body to ResponseBody.
Compelling alternative is ReadableBody and WritableBody, or BodySource and BodySink.
Which in theory permits reuse for serverside body makers. But I don't like those names
as much.
2014-05-10 08:26:44 -04:00
Adrian Cole
499f402d05 Merge pull request #764 from square/adrian.callfusion
Merge Job into Call. CallTest = AsyncApiTest + SyncApiTest
2014-04-25 13:00:59 -07:00
Adrian Cole
63d4dfaaa6 Merge Job into Call. CallTest = AsyncApiTest + SyncApiTest. 2014-04-25 11:13:39 -07:00
Jake Wharton
7bfcaa60e2 Use more convenience methods from Okio 0.8.0. 2014-04-25 09:23:34 -07:00
Jesse Wilson
307c7a144a Scrub StatusLine from the public API.
The status line is an unnecessary grouping of three otherwise-independent
fields: the protocol, code and message.

Combining them in the API doesn't provide much value. In SPDY and HTTP/2
these are broken apart anyway.
2014-04-19 15:28:40 -04:00
Jesse Wilson
62a7ea2d20 Make Buffer the body type in MockResponse. 2014-04-17 20:19:16 -04:00
Jake Wharton
b8e50f57d3 Update OkApacheClient to use new API. 2014-04-17 14:52:36 -07:00
jwilson
8535f2447c Repackage mockwebserver in com.squareup.okhttp.mockwebserver. 2013-08-05 18:04:25 -04:00
Kristopher Wuollett
a87b569d01 Added check for length < 0 for transparent gzip response.
The documentation for org.apache.http.HttpEntity::getContentLength()
states that a negative number will be returned when the length of the
content is not known.
2013-07-12 00:06:21 -07:00
Kristopher Wuollett
8035fda72f Added contentType/Encoding to HttpResponse's Entity.
Clients should expect that OkHttpClient HttpResponse Entity's contentType
and contentEncoding are not null when the headers are present.
2013-07-11 23:02:47 -07:00
jwilson
5f87fc19ab Introduce a Policy interface between engine and connection.
This breaks the direct dependency from HttpEngine to
HttpURLConnectionImpl. With this dependency broken, we
can start to use HttpEngine directly from Dispatcher and
Job.
2013-07-09 01:57:50 -04:00
Jake Wharton
53e12cca33 Request entity tests for the Apache client shim. 2013-07-04 00:03:28 -07:00
Jake Wharton
f163915346 Null-check request entity since it might not be present.
Closes #198.
2013-05-27 14:53:16 -07:00
Jake Wharton
7f4d253579 Add some tests for the Apache wrapper. 2013-05-06 16:53:59 -07:00
Jake Wharton
d60c084b99 Add Apache HttpClient implementation which maps to OkHttp.
Refs #17.
2013-03-26 13:27:46 -04:00