Skip to content

Commit

Permalink
Merge branch 'master' into _allow_socket
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke authored Nov 20, 2024
2 parents ca077a6 + aac6c70 commit 9085aea
Show file tree
Hide file tree
Showing 20 changed files with 271 additions and 192 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Upload Artifacts
run: ./gradlew clean publish --stacktrace
Expand All @@ -49,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/wrapper-validation@v4
- name: Validate Renovate
uses: rinchsan/[email protected]
with:
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew check -PandroidBuild=true -PgraalBuild=true -x test -x test
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dtest.java.version=11
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dtest.java.version=11
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dtest.java.version=8
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dtest.java.version=8 -Dokhttp.platform=jdk8alpn -Dalpn.boot.version=8.1.13.v20181017 -Dorg.gradle.java.installations.paths=/opt/hostedtoolcache/Java_Adopt_jdk/8.0.242-8.1/x64
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dtest.java.version=8 -Dokhttp.platform=openjsse
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dokhttp.platform=conscrypt
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dokhttp.platform=bouncycastle
Expand Down Expand Up @@ -325,7 +325,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dokhttp.platform=corretto
Expand Down Expand Up @@ -354,7 +354,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dtest.java.version=17
Expand Down Expand Up @@ -389,7 +389,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dtest.java.version=21
Expand Down Expand Up @@ -418,7 +418,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Test
run: ./gradlew test
Expand Down Expand Up @@ -447,13 +447,13 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Build okcurl
run: ./gradlew okcurl:nativeImage

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Build ConsoleLauncher
run: ./gradlew -PgraalBuild=true native-image-tests:nativeImage
Expand Down Expand Up @@ -500,7 +500,7 @@ jobs:
sudo udevadm trigger --name-match=kvm
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Gradle cache
run: ./gradlew -PandroidBuild=true :okhttp-android:test
Expand Down Expand Up @@ -572,7 +572,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Checks
run: ./gradlew test -Dokhttp.platform=loom -Dtest.java.version=21 -PcontainerTests=true
Expand Down Expand Up @@ -616,7 +616,7 @@ jobs:
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: AVD cache
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run Container Tests
run: ./gradlew container-tests:test -PcontainerTests=true
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ configured to fall back for broad connectivity.
Using OkHttp is easy. Its request/response API is designed with fluent builders and immutability. It
supports both synchronous blocking calls and async calls with callbacks.

A well behaved user agent
-------------------------

OkHttp follows modern HTTP specifications such as

* HTTP/1.1 - [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231)
* HTTP/2 - [RFC 9113](https://datatracker.ietf.org/doc/html/rfc9113)
* Websockets - [RFC 6455](https://datatracker.ietf.org/doc/html/rfc6455)
* SSE - [Server-sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events)

Where the spec is ambiguous, OkHttp follows modern user agents such as popular Browsers or common HTTP Libraries.

OkHttp is principled and avoids being overly configurable, especially when such configuration is
to workaround a buggy server, test invalid scenarios or that contradict the relevant RFC.
Other HTTP libraries exist that fill that gap allowing extensive customisation including potentially
invalid requests.

Example Limitations

* Does not allow GET with a body.
* Cache is not an interface with alternative implementations.

Get a URL
---------
Expand Down Expand Up @@ -129,6 +150,11 @@ The latest release is available on [Maven Central](https://search.maven.org/arti
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
```

MockWebServer is used for firstly for internal testing, and for basic testing of apps using OkHttp client.
It is not a full featured HTTP testing library that is developed standalone. It is not being actively developed
for new features. As such you might find your needs outgrow MockWebServer and you may which to use a
more full featured testing library such as [MockServer](https://www.mock-server.com/).

GraalVM Native Image
--------------------

Expand Down
46 changes: 23 additions & 23 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[versions]
biz-aQute-bnd = "6.4.0"
checkStyle = "10.17.0"
checkStyle = "10.19.0"
com-squareup-moshi = "1.15.1"
com-squareup-okio = "3.9.0"
de-mannodermaus-junit5 = "1.4.0"
com-squareup-okio = "3.9.1"
de-mannodermaus-junit5 = "1.5.0"
graalvm = "22.3.2"
kotlinx-serialization = "1.6.3"
ksp = "1.9.24-1.0.20"
mockserverClient = "5.15.0"
org-bouncycastle = "1.76"
org-conscrypt = "2.5.2"
org-jetbrains-coroutines = "1.8.1"
org-jetbrains-kotlin = "1.9.24"
org-junit-jupiter = "5.10.3"
org-jetbrains-kotlin = "1.9.25"
org-junit-jupiter = "5.11.3"
retrofit = "2.11.0"
testcontainers = "1.19.8"
testcontainers = "1.20.1"

[libraries]
amazonCorretto = "software.amazon.cryptools:AmazonCorrettoCryptoProvider:2.3.3"
androidx-activity = "androidx.activity:activity-ktx:1.9.0"
androidx-annotation = "androidx.annotation:annotation:1.8.0"
amazonCorretto = "software.amazon.cryptools:AmazonCorrettoCryptoProvider:2.4.1"
androidx-activity = "androidx.activity:activity-ktx:1.9.3"
androidx-annotation = "androidx.annotation:annotation:1.8.2"
androidx-espresso-core = "androidx.test.espresso:espresso-core:3.6.1"
androidx-junit = "androidx.test.ext:junit:1.1.5"
androidx-test-runner = "androidx.test:runner:1.5.2"
animalsniffer-annotations = "org.codehaus.mojo:animal-sniffer-annotations:1.23"
androidx-junit = "androidx.test.ext:junit:1.2.1"
androidx-test-runner = "androidx.test:runner:1.6.2"
animalsniffer-annotations = "org.codehaus.mojo:animal-sniffer-annotations:1.24"
aqute-resolve = { module = "biz.aQute.bnd:biz.aQute.resolve", version.ref = "biz-aQute-bnd" }
assertk = "com.willowtreeapps.assertk:assertk:0.28.1"
bouncycastle-bcpkix = { module = "org.bouncycastle:bcpkix-jdk15to18", version.ref = "org-bouncycastle" }
Expand All @@ -36,12 +36,12 @@ codehaus-signature-java18 = "org.codehaus.mojo.signature:java18:1.0"
conscrypt-android = { module = "org.conscrypt:conscrypt-android", version.ref = "org-conscrypt" }
conscrypt-openjdk = { module = "org.conscrypt:conscrypt-openjdk-uber", version.ref = "org-conscrypt" }
converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" }
eclipseOsgi = "org.eclipse.platform:org.eclipse.osgi:3.20.0"
eclipseOsgi = "org.eclipse.platform:org.eclipse.osgi:3.21.0"
findbugs-jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
gradlePlugin-android = "com.android.tools.build:gradle:8.2.0"
gradlePlugin-androidJunit5 = "de.mannodermaus.gradle.plugins:android-junit5:1.10.0.0"
gradlePlugin-androidJunit5 = "de.mannodermaus.gradle.plugins:android-junit5:1.11.2.0"
gradlePlugin-animalsniffer = "ru.vyarus:gradle-animalsniffer-plugin:1.7.1"
gradlePlugin-binaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin:0.14.0"
gradlePlugin-binaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin:0.16.3"
gradlePlugin-bnd = { module = "biz.aQute.bnd:biz.aQute.bnd.gradle", version.ref = "biz-aQute-bnd" }
gradlePlugin-dokka = "org.jetbrains.dokka:dokka-gradle-plugin:1.9.20"
gradlePlugin-errorprone = "net.ltgt.gradle:gradle-errorprone-plugin:4.0.1"
Expand All @@ -52,19 +52,19 @@ gradlePlugin-mavenPublish = "com.vanniktech:gradle-maven-publish-plugin:0.29.0"
gradlePlugin-mavenSympathy = "io.github.usefulness.maven-sympathy:io.github.usefulness.maven-sympathy.gradle.plugin:0.3.0"
gradlePlugin-shadow = "gradle.plugin.com.github.johnrengelman:shadow:8.0.0"
gradlePlugin-spotless = "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
guava-jre = "com.google.guava:guava:33.2.1-jre"
hamcrestLibrary = "org.hamcrest:hamcrest-library:2.2"
guava-jre = "com.google.guava:guava:33.3.0-jre"
hamcrestLibrary = "org.hamcrest:hamcrest-library:3.0"
httpClient5 = "org.apache.httpcomponents.client5:httpclient5:5.3.1"
jettyClient = "org.eclipse.jetty:jetty-client:9.4.54.v20240208"
jnr-unixsocket = "com.github.jnr:jnr-unixsocket:0.38.22"
jsoup = "org.jsoup:jsoup:1.17.2"
jettyClient = "org.eclipse.jetty:jetty-client:9.4.56.v20240826"
jnr-unixsocket = "com.github.jnr:jnr-unixsocket:0.38.23"
jsoup = "org.jsoup:jsoup:1.18.1"
junit = "junit:junit:4.13.2"
junit-ktx = "androidx.test.ext:junit-ktx:1.1.5"
junit-ktx = "androidx.test.ext:junit-ktx:1.2.1"
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "org-junit-jupiter" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "org-junit-jupiter" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "org-junit-jupiter" }
junit-platform-console = "org.junit.platform:junit-platform-console:1.10.3"
junit-vintage-engine = "org.junit.vintage:junit-vintage-engine:5.10.3"
junit-platform-console = "org.junit.platform:junit-platform-console:1.11.3"
junit-vintage-engine = "org.junit.vintage:junit-vintage-engine:5.11.3"
junit-pioneer = "org.junit-pioneer:junit-pioneer:1.9.1"
junit5android-core = { module = "de.mannodermaus.junit5:android-test-core", version.ref = "de-mannodermaus-junit5" }
junit5android-runner = { module = "de.mannodermaus.junit5:android-test-runner", version.ref = "de-mannodermaus-junit5" }
Expand Down
Loading

0 comments on commit 9085aea

Please sign in to comment.