1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-14 07:22:20 +03:00
Commit Graph

104 Commits

Author SHA1 Message Date
Jesse Wilson
482f88300f Merge pull request #6040 from square/jwilson.0509.insecureHost
HandshakeCertificates.Builder.addInsecureHost()
2020-05-11 18:04:02 -04:00
Jesse Wilson
1364ea44ae HandshakeCertificates.Builder.addInsecureHost()
This API continues the work started here:
https://github.com/square/okhttp/pull/5872
2020-05-11 17:35:02 -04:00
Yuri Schimke
2d21be1184 Custom trust example & API for certificate decoding (#6032) 2020-05-09 14:40:15 +01:00
Yuri Schimke
0ea6ca0faa Allowlist Sample for connecting to Dev servers (#5868) 2020-03-16 09:09:22 +00:00
Jesse Wilson
08e23fcd02 Add a canceled event to EventListener 2020-02-16 18:20:49 -05:00
Jesse Wilson
c1d50e371f Upgrade Okio and some build dependencies
The new ktlint sorts imports which makes this diff large.

The new japicmp ignores 'final' modifier changes in final classes.

We adopt the Google style for checkstyle.xml.

Okio readByteString() now uses segments more aggressively, so we
need to mitigate that to avoid tracking those segments in a test.
2020-01-11 22:24:12 -05:00
Yuri Schimke
b2168ceb73 Fixup samples (#5699) 2020-01-05 15:14:58 +00:00
Yuri Schimke
b9d30d67ac Samples cleanup 2019-12-08 21:30:01 +00:00
Jesse Wilson
7c802961af Add Kotlin listings for OkHttp recipes doc 2019-09-28 14:00:26 -04:00
Yuri Schimke
2a1f328d58 Add proxy event logging (#5300) 2019-07-25 05:42:32 +01:00
Jesse Wilson
eb7a0839ab Suppress AllMainsTest.
It won't work in CI
2019-06-24 14:28:12 -07:00
Yuri Schimke
26949cf478 Fix samples and add test (#5228)
* Fix samples

* support different paths

* Simplify
2019-06-24 05:59:42 -07:00
Jesse Wilson
8bb58332db Extension Functions toRequestBody(), toResponseBody() 2019-05-25 14:02:55 -04:00
Jesse Wilson
dedc6ecd5b Use more AssertJ features 2019-03-14 17:57:42 -04:00
Jesse Wilson
aac6c8da07 Introduce EventListener.requestFailed, responseFailed events
These replace requestBodyEnd() / responseBodyEnd() in some failure scenarios.
They may also be issued in cases where no event was published previously.
2019-02-23 18:39:11 -05:00
Jesse Wilson
778e0334a4 Use lambdas where appropriate 2019-01-11 22:31:36 -05:00
Jesse Wilson
bcbbfc6a54 Make the nested BasicAuthInterceptor static (#4368) 2018-11-05 07:46:46 +00:00
jjshanks
0a8f418644 Add basic auth interceptor recipe (#4336) 2018-11-04 18:05:01 +00:00
Joshua Shanks
c951e6ed88 APIs to set date headers 2018-10-31 08:32:50 -07:00
Jesse Wilson
c07b8fddc9 HTTPS server sample 2018-07-12 22:46:57 -04:00
Jake Wharton
36f4fd04f7 Add parse overload which fails on invalid inputs 2018-07-05 23:18:15 -04:00
Yuri Schimke
fe445e4db6 Improve progress example (#3744)
* improve progress example

* bad import
2017-12-28 13:43:43 -05:00
Yuri Schimke
d6fd0d3832 Fix travis build 2017-09-12 08:32:24 +01:00
jwilson
b926a030c6 Add samples for EventListener 2017-09-06 12:11:37 -04:00
jwilson
83b9dd4275 Upgrade to Checktyle 7.7.
This allows us to put @Nullable immediately preceding the return type,
which is exactly where we want it.
2017-05-06 14:21:55 -04:00
jwilson
2d37490174 Add a sample where data is streamed via an Okio pipe. 2017-03-22 21:07:56 -04:00
Jesse Wilson
bdcd06f8ca Merge pull request #3091 from square/jwilson.0107.custom_cipher_siutes
Example on customizing cipher suites.
2017-01-07 21:33:20 -05:00
jwilson
cbe7baa474 Fix examples to give up if authentication fails.
Closes: https://github.com/square/okhttp/issues/2464
2017-01-07 18:45:32 -05:00
jwilson
bb0f81e1b8 Example on customizing cipher suites.
It's a disgusting amount of code unfortunately.

Closes: https://github.com/square/okhttp/issues/2698
2017-01-07 18:28:26 -05:00
jwilson
949439ae5b Rename NewWebSocket to WebSocket.
The synchronous WebSocket class is gone.
2016-11-19 15:16:58 -05:00
jwilson
40dddb9dcf Migrate MockWebServer to the async web sockets API. 2016-11-18 21:34:02 -05:00
Jake Wharton
90f6bcb21f Remove inconsistent 'send' prefix from message/ping methods. 2016-10-11 23:08:49 -04:00
Jake Wharton
6306aec01d Use ByteString for web socket ping/pong payloads. 2016-09-20 00:53:36 -04:00
Jake Wharton
508eb90b3c Web socket API and implementation improvements.
* onFailure callback's exception type widened to Throwable. This allows runtime exceptions from other callbacks to be passed along.
* Ensure the connection is closed properly for all failures.
* Fix and document the threading inside RealWebSocket. This ensures the listener is always called on the same thread and replies always happen from the correct thread.
2016-09-19 23:53:55 -04:00
Jake Wharton
039bcf92db Move WebSockets from separate artifact to main.
The factory method has moved to OkHttpClient and WebSocketCall has changed to an interface.
2016-09-13 12:29:19 -04:00
Jonh Wendell
7b2cbab2b7 Improve WebSocketEcho example
Shutdown the executor upon close or failure. This avoids the program
hanging after finished the execution.

Set the client read timeout to 0 (the default timeout is 10s). A read
timeout doesn't make sense for a WebSocket.
2016-08-13 13:40:20 -03:00
jwilson
3699d5c9fd Better documentation and examples on closing response bodies.
Also implement Closeable on Response to make it easier to do the right thing.
2016-05-21 21:29:42 -04:00
jwilson
94bda42362 Pin fewer certificates in our sample.
Closes: https://github.com/square/okhttp/issues/2535
2016-05-07 18:21:50 -04:00
jwilson
ad103f421e Use Moshi in OkHttp.
As discussed here: https://github.com/square/okhttp/pull/2492
2016-04-21 23:20:30 -10:00
jwilson
85f74e2004 Accept user-provided trust managers in OkHttpClient.Builder
Closes: https://github.com/square/okhttp/issues/2427
2016-03-28 19:02:25 -04:00
jwilson
7396ac00bc Implement support for SHA-256 pins.
Closes: https://github.com/square/okhttp/issues/1539
2016-02-21 18:38:04 -05:00
Dave Roberge
0f4d824418 Updated gson recipe to close response body. 2016-01-16 13:52:53 -05:00
jwilson
8ff3725031 Change Callback to take a Call.
This makes it much easier to test if the call was canceled.

Note that the Call's request is always the original user request.
This is different than the previous request that was passed in, as
that could have been the follow up to a redirect.
2016-01-11 15:40:28 -08:00
jwilson
a2d9f7cfa9 Adjust documentation for OkHttp 3. 2016-01-02 09:34:47 -05:00
jwilson
7826bcb2fb Fix some get prefixes on Cache and ConnectionPool. 2016-01-02 02:07:30 -05: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
e7023e0344 Sort more 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:37:17 -05:00
jwilson
02d6b4e78c Drop the get prefix on Connection accessors. 2015-12-21 21:10:48 -05:00