• Home
Name Date Size #Lines LOC

..--

android/03-May-2024-1,244817

benchmarks/03-May-2024-1,005707

mockwebserver/03-May-2024-2,3741,648

okcurl/03-May-2024-457366

okhttp/03-May-2024-16,31110,449

okhttp-apache/03-May-2024-513423

okhttp-tests/03-May-2024-17,04412,976

okio/03-May-2024-4,8743,160

samples/03-May-2024-614494

website/03-May-2024-552473

Android.mkD03-May-20243.3 KiB8559

CHANGELOG.mdD03-May-20245.9 KiB180124

CONTRIBUTING.mdD03-May-2024732 1812

LICENSE.txtD03-May-202411.1 KiB203169

MODULE_LICENSE_APACHE2D03-May-20240

README.androidD03-May-2024507 1411

README.mdD03-May-20242.9 KiB10771

build.gradleD03-May-2024293 1714

checkstyle.xmlD03-May-20244.6 KiB13264

concurrency.mdD03-May-20244.8 KiB6432

deploy_website.shD03-May-2024916 4621

jarjar-rules.txtD03-May-202469 32

pom.xmlD03-May-20246.1 KiB203182

README.android

1URL: https://github.com/square/okhttp
2License: Apache 2
3Description: "OkHttp: An HTTP+SPDY client for Android and Java applications."
4
5Local patches
6-------------
7
8- Addition of classes in android/ :
9  - com.squareup.okhttp.internal.Platform - to replace the Platform class that
10    comes with okhttp. No use of reflection.
11  - com.squareup.okhttp.Http(s)Handler - integration with Android's corelibs.
12  - Removal of reference to a codehause annotation used in
13    okio/src/main/java/okio/DeflaterSink.java
14

README.md

1OkHttp
2======
3
4An HTTP & SPDY client for Android and Java applications.
5
6For more information please see [the website][1].
7
8
9
10Download
11--------
12
13Download [the latest JAR][2] or grab via Maven:
14
15```xml
16<dependency>
17    <groupId>com.squareup.okhttp</groupId>
18    <artifactId>okhttp</artifactId>
19    <version>(insert latest version)</version>
20</dependency>
21```
22
23
24Building
25--------
26
27OkHttp requires Java 7 to build and run tests. Runtime compatibility with Java 6 is enforced as
28part of the build to ensure compliance with Android and older versions of the JVM.
29
30
31
32Testing
33-------
34
35### On the Desktop
36
37Run OkHttp tests on the desktop with Maven. Running SPDY tests on the desktop uses
38[Jetty-NPN][3] which requires OpenJDK 7+.
39
40```
41mvn clean test
42```
43
44### On a Device
45
46OkHttp's test suite creates an in-process HTTPS server. Prior to Android 2.3, SSL server sockets
47were broken, and so HTTPS tests will time out when run on such devices.
48
49Test on a USB-attached Android using [Vogar][4]. Unfortunately `dx` requires that you build with
50Java 6, otherwise the test class will be silently omitted from the `.dex` file.
51
52```
53mvn clean
54mvn package -DskipTests
55vogar \
56    --classpath ~/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar \
57    --classpath mockwebserver/target/mockwebserver-2.0.0-SNAPSHOT.jar \
58    --classpath okhttp-protocols/target/okhttp-protocols-2.0.0-SNAPSHOT.jar \
59    --classpath okhttp/target/okhttp-2.0.0-SNAPSHOT.jar \
60    okhttp/src/test
61```
62
63MockWebServer
64-------------
65
66A library for testing HTTP, HTTPS, HTTP/2.0, and SPDY clients.
67
68MockWebServer coupling with OkHttp is essential for proper testing of SPDY and HTTP/2.0 so that code can be shared.
69
70### Download
71
72Download [the latest JAR][5] or grab via Maven:
73
74```xml
75<dependency>
76    <groupId>com.squareup.okhttp</groupId>
77    <artifactId>mockwebserver</artifactId>
78    <version>(insert latest version)</version>
79    <scope>test</scope>
80</dependency>
81```
82
83
84License
85-------
86
87    Licensed under the Apache License, Version 2.0 (the "License");
88    you may not use this file except in compliance with the License.
89    You may obtain a copy of the License at
90
91       http://www.apache.org/licenses/LICENSE-2.0
92
93    Unless required by applicable law or agreed to in writing, software
94    distributed under the License is distributed on an "AS IS" BASIS,
95    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96    See the License for the specific language governing permissions and
97    limitations under the License.
98
99
100
101
102 [1]: http://square.github.io/okhttp
103 [2]: http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.squareup.okhttp&a=okhttp&v=LATEST
104 [3]: http://wiki.eclipse.org/Jetty/Feature/NPN
105 [4]: https://code.google.com/p/vogar/
106 [5]: http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.squareup.okhttp&a=mockwebserver&v=LATEST
107