- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 685 for isSuccessful (0.22 sec)
-
samples/guide/src/main/java/okhttp3/recipes/CustomCipherSuites.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.handshake().cipherSuite()); System.out.println(response.body().string()); } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Mar 14 21:57:42 UTC 2019 - 6.5K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CustomTrust.java
Request request = new Request.Builder() .url("https://publicobject.com/helloworld.txt") .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) { Headers responseHeaders = response.headers(); for (int i = 0; i < responseHeaders.size(); i++) { System.out.println(responseHeaders.name(i) + ": " + responseHeaders.value(i)); }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Aug 12 07:26:27 UTC 2021 - 9.3K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java
.url("https://www.googleapis.com/urlshortener/v1/url?key=" + GOOGLE_API_KEY) .post(jsonRequestBody) .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 {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat May 25 18:02:55 UTC 2019 - 3.8K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/CustomTrust.kt
} private fun showUrl(url: String) { val request = Builder().url(url).build() client.newCall(request) .execute() .use { response -> if (!response.isSuccessful) { val responseHeaders = response.headers for (i in 0 until responseHeaders.size) { println(responseHeaders.name(i) + ": " + responseHeaders.value(i)) }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 8.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/DuplexTest.kt
client = client.newBuilder() .readTimeout(1000, TimeUnit.MILLISECONDS) .build() val call = client.newCall(request) val response = call.execute() assertThat(response.isSuccessful).isTrue() } /** * We delay sending the last byte of the request body 1500 ms. The 1000 ms read timeout shouldn't * elapse because it shouldn't start until the request body is sent. */ @Test
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 20 10:30:28 UTC 2024 - 23.9K bytes - Viewed (0) -
okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt
Platform.get().log("Incorrect protocol: ${response.protocol}", Platform.WARN) } response.use { if (!response.isSuccessful) { throw IOException("response: " + response.code + " " + response.message) } val body = response.body if (body.contentLength() > MAX_RESPONSE_SIZE) { throw IOException(
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Oct 31 09:27:31 UTC 2024 - 9.8K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/Response.kt
) fun code(): Int = code /** * Returns true if the code is in [200..300), which means the request was successfully received, * understood, and accepted. */ val isSuccessful: Boolean = commonIsSuccessful @JvmName("-deprecated_message") @Deprecated( message = "moved to val", replaceWith = ReplaceWith(expression = "message"), level = DeprecationLevel.ERROR, )
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jul 06 09:38:30 UTC 2024 - 15.6K bytes - Viewed (0) -
docs/changelogs/changelog_2x.md
```java Headers headers = Headers.of(name1, value1, name2, value2, ...). ``` * New: Make the content-type header optional for request bodies. * New: `Response.isSuccessful()` is a convenient API to check response codes. * New: The response body can now be read outside of the callback. Response bodies must always be closed, otherwise they will leak connections!
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 06 02:19:09 UTC 2022 - 26.6K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt
val response: Response = Response.Builder().build() val request: Request = response.request val protocol: Protocol = response.protocol val code: Int = response.code val successful: Boolean = response.isSuccessful val message: String = response.message val handshake: Handshake? = response.handshake val headersForName: List<String> = response.headers("") val header: String? = response.header("")
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 01 14:21:25 UTC 2024 - 46.5K bytes - Viewed (0) -
okhttp/api/okhttp.api
public final fun headers ()Lokhttp3/Headers; public final fun headers (Ljava/lang/String;)Ljava/util/List; public final fun isRedirect ()Z public final fun isSuccessful ()Z public final fun message ()Ljava/lang/String; public final fun networkResponse ()Lokhttp3/Response; public final fun newBuilder ()Lokhttp3/Response$Builder; public final fun peekBody (J)Lokhttp3/ResponseBody;
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 15 13:41:01 UTC 2024 - 70.2K bytes - Viewed (0)