- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 685 for isSuccessful (0.11 sec)
-
samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java
.url("https://api.github.com/markdown/raw") .post(requestBody) .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println(response.body().string()); } } public static void main(String... args) throws Exception { new PostStreaming().run();
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Jul 06 03:18:15 UTC 2018 - 2.1K bytes - Viewed (0) -
docs/features/https.md
fun run() { val request = Request.Builder() .url("https://publicobject.com/robots.txt") .build() client.newCall(request).execute().use { response -> if (!response.isSuccessful) throw IOException("Unexpected code $response") for (certificate in response.handshake!!.peerCertificates) { println(CertificatePinner.pin(certificate)) } } } ```
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Dec 24 00:16:30 UTC 2022 - 10.5K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/AccessHeaders.kt
.addHeader("Accept", "application/json; q=0.5") .addHeader("Accept", "application/vnd.github.v3+json") .build() client.newCall(request).execute().use { response -> if (!response.isSuccessful) throw IOException("Unexpected code $response") println("Server: ${response.header("Server")}") println("Date: ${response.header("Date")}") println("Vary: ${response.headers("Vary")}") } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java
.post(pipeBody) .build(); streamPrimesToSinkAsynchronously(pipeBody.sink()); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println(response.body().string()); } } private void streamPrimesToSinkAsynchronously(final BufferedSink sink) {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Jul 06 03:18:15 UTC 2018 - 3.1K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/CertificatePinning.kt
fun run() { val request = Request.Builder() .url("https://publicobject.com/robots.txt") .build() client.newCall(request).execute().use { response -> if (!response.isSuccessful) throw IOException("Unexpected code $response") for (certificate in response.handshake!!.peerCertificates) { println(CertificatePinner.pin(certificate)) } } } } fun main() {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostForm.java
.url("https://en.wikipedia.org/w/index.php") .post(formBody) .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println(response.body().string()); } } public static void main(String... args) throws Exception { new PostForm().run();
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun May 22 01:29:42 UTC 2016 - 1.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/Authenticate.kt
fun run() { val request = Request.Builder() .url("http://publicobject.com/secrets/hellosecret.txt") .build() client.newCall(request).execute().use { response -> if (!response.isSuccessful) throw IOException("Unexpected code $response") println(response.body.string()) } } } fun main() { Authenticate().run()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.9K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CertificatePinning.java
Request request = new Request.Builder() .url("https://publicobject.com/robots.txt") .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); for (Certificate certificate : response.handshake().peerCertificates()) { System.out.println(CertificatePinner.pin(certificate)); } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Dec 08 21:30:01 UTC 2019 - 1.7K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/AccessHeaders.java
.addHeader("Accept", "application/json; q=0.5") .addHeader("Accept", "application/vnd.github.v3+json") .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println("Server: " + response.header("Server")); System.out.println("Date: " + response.header("Date"));
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun May 22 01:29:42 UTC 2016 - 1.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CheckHandshake.java
Request request = new Request.Builder() .url("https://publicobject.com/helloworld.txt") .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println(response.body().string()); } } public static void main(String... args) throws Exception { new CheckHandshake().run();
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 15 14:55:09 UTC 2024 - 2.1K bytes - Viewed (0)