The Wayback Machine - https://web.archive.org/web/20190618050046/https://github.com/square/okhttp
Skip to content
An HTTP+HTTP/2 client for Android and Java applications.
Branch: master
Clone or download
swankjesse Merge pull request #5192 from square/yschimke-patch-1
Remove reference to legacy okio
Latest commit f6dc2a0 Jun 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.buildscript Configure gradle artifact uploads Mar 17, 2019
.circleci Ignore gh-pages branch in circleci May 18, 2019
.github Basic Gradle support Mar 17, 2019
docs/images Move documentation images from the wiki into the main repo Jun 8, 2019
fuzzing Move tests from okhttp-tests/src/test/java to okhttp/src/test/java Mar 26, 2019
gradle/wrapper Gradle 5.4 upgrade (#4959) Apr 16, 2019
mockwebserver Increase severity of bridge methods to ERROR. (#5160) Jun 3, 2019
okcurl Remove most of the SAM bridges Jun 2, 2019
okhttp-dnsoverhttps Remove the Kotlin migration bridges from DnsOverHttps (#5157) Jun 2, 2019
okhttp-hpacktests Convert Hpack to Kotlin (#4987) Apr 28, 2019
okhttp-logging-interceptor Move docs from GitHub wiki into the main repo. Jun 6, 2019
okhttp-sse Replace MediaType.get(string) with string.toMediaType() (#5132) May 27, 2019
okhttp-testing-support Fix race condition in RecordingHostnameVerifier Apr 23, 2019
okhttp-tls Increase severity of bridge methods to ERROR. (#5160) Jun 3, 2019
okhttp-urlconnection New releasing guide. May 26, 2019
okhttp Use asX() instead of toX() when a view is returned (#5187) Jun 15, 2019
samples Extension Functions toRequestBody(), toResponseBody() May 25, 2019
website Move docs from GitHub wiki into the main repo. Jun 6, 2019
.gitignore Add local.properties to .gitignore Mar 25, 2019
.gitmodules Add hpack-test-case test module. Jul 6, 2014
.travis.yml Build in Travis CI only on master (#5062) May 19, 2019
BUG-BOUNTY.md Includes this repo in our open source bug bounty program. May 11, 2015
CALLS.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
CHANGELOG.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
CONCURRENCY.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
CONNECTIONS.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
CONTRIBUTING.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
EVENTS.md Move documentation images from the wiki into the main repo Jun 8, 2019
HTTPS.md Add syntax highlighting to code snippets in HTTPS.md Jun 10, 2019
INTERCEPTORS.md Move documentation images from the wiki into the main repo Jun 8, 2019
LICENSE.txt Initial import. Jul 23, 2012
README.md Remove reference to legacy okio Jun 16, 2019
RECIPES.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
RELEASING.md New releasing guide. May 26, 2019
SECURITY.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
TLS_CONFIGURATION_HISTORY.md Move documentation images from the wiki into the main repo Jun 8, 2019
UPGRADING_TO_OKHTTP_4.md Use asX() instead of toX() when a view is returned (#5187) Jun 15, 2019
WORKS_WITH_OKHTTP.md Move docs from GitHub wiki into the main repo. Jun 6, 2019
build.gradle Kotlin 1.3.31 upgrade (#5064) May 18, 2019
checkstyle.xml Basic Gradle support Mar 17, 2019
deploy_website.sh Update links to Javadoc. Oct 26, 2015
gradle.properties Prepare next development version. Jun 4, 2019
gradlew Gradle upgrade 5.3 Mar 22, 2019
gradlew.bat Gradle upgrade 5.3 Mar 22, 2019
settings.gradle Move tests from okhttp-tests/src/test/java to okhttp/src/test/java Mar 26, 2019

README.md

OkHttp

An HTTP & HTTP/2 client for Android and Java applications.

Docs

Requirements

OkHttp works on Android 5.0+ (API level 21+) and on Java 8+.

OkHttp has one library dependency on Okio, a small library for high-performance I/O.

We highly recommend you keep OkHttp up-to-date. As with auto-updating web browsers, staying current with HTTPS clients is an important defense against potential security problems. We track the dynamic TLS ecosystem and adjust OkHttp to improve connectivity and security.

OkHttp uses your platform's built-in TLS implementation. On Java platforms OkHttp also supports Conscrypt, which integrates BoringSSL with Java. OkHttp will use Conscrypt if it is the first security provider:

Security.insertProviderAt(Conscrypt.newProvider(), 1);

The OkHttp 3.12.x branch supports Android 2.3+ (API level 9+) and Java 7+. These platforms lack support for TLS 1.2 and should not be used. But because upgrading is difficult we will backport critical fixes to the 3.12.x branch through December 31, 2020.

Releases

Our change log has release history.

implementation("com.squareup.okhttp3:okhttp:3.14.2")

Snapshot builds are available.

MockWebServer

OkHttp includes a library for testing HTTP, HTTPS, and HTTP/2 clients.

testImplementation("com.squareup.okhttp3:mockwebserver:3.14.2")

R8 / ProGuard

If you are using R8 or ProGuard add the options from okhttp3.pro.

You might also need rules for Okio which is a dependency of this library.

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.