- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 106 for newCall (0.06 sec)
-
okhttp/src/test/java/okhttp3/InsecureForHostTest.kt
.build() val client = clientTestRule.newClientBuilder() .sslSocketFactory(clientCertificates.sslSocketFactory(), clientCertificates.trustManager) .build() val call = client.newCall(Request(server.url("/"))) val response = call.execute() assertThat(response.code).isEqualTo(200) assertThat(response.handshake!!.cipherSuite).isNotNull() assertThat(response.handshake!!.tlsVersion).isNotNull()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 4.2K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt
val call1 = localClient.newCall(Request(server.url("/"))) call1.execute().use { response -> assertThat(response.body.string()).isEqualTo("Req1") assertThat(response.handshake).isNotNull() assertThat(response.protocol == Protocol.HTTP_1_1) } eventListener.closed = true val call2 = localClient.newCall(Request(server.url("/")))
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 9.5K bytes - Viewed (0) -
native-image-tests/src/main/kotlin/okhttp3/SampleTest.kt
server.enqueue(MockResponse(body = "abc")) val client = clientRule.newClient() client.newCall(Request(url = server.url("/"))).execute().use { assertThat(it.body.string()).isEqualTo("abc") } } @Test fun testExternalSite() { val client = clientRule.newClient() client.newCall(Request(url = "https://google.com/robots.txt".toHttpUrl())).execute().use { assertThat(it.code).isEqualTo(200)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.8K bytes - Viewed (0) -
okhttp-android/src/test/kotlin/okhttp3/android/RobolectricOkHttpClientTest.kt
val networkRequest = request.newBuilder() .build() val call = client.newCall(networkRequest) call.execute().use { response -> assertThat(response.code).isEqualTo(200) assertThat(response.cacheResponse).isNull() } val cachedCall = client.newCall(request) cachedCall.execute().use { response -> assertThat(response.code).isEqualTo(200)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Apr 10 19:46:48 UTC 2024 - 2.5K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/SocksProxyTest.kt
.build() val request1 = Request.Builder().url(server.url("/")).build() val response1 = client.newCall(request1).execute() assertThat(response1.body.string()).isEqualTo("abc") val request2 = Request.Builder().url(server.url("/")).build() val response2 = client.newCall(request2).execute() assertThat(response2.body.string()).isEqualTo("def") // The HTTP calls should share a single connection.
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 3.5K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/CallKotlinTest.kt
.header("Content-Type", "application/xml") .put(ValidRequestBody()) .build() client.newCall(request).execute().use { assertEquals(201, it.code) } request = Request.Builder() .url(endpointUrl) .head() .build() client.newCall(request).execute().use { assertEquals(204, it.code) } request = Request.Builder()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 20 10:30:28 UTC 2024 - 8.4K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/ConnectionListenerTest.kt
enableTls() server!!.protocols = listOf(Protocol.HTTP_2, Protocol.HTTP_1_1) server!!.enqueue(MockResponse()) server!!.enqueue(MockResponse()) client.newCall(Request(server!!.url("/"))) .execute().close() client.newCall(Request(server!!.url("/"))) .execute().close() assertThat(listener.recordedEventTypes()).containsExactly( "ConnectStart", "ConnectEnd",
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 20 10:30:28 UTC 2024 - 9.6K bytes - Viewed (0) -
container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt
MockServerContainer(MOCKSERVER_IMAGE) .withNetworkAliases("mockserver") @Test fun testOkHttpDirect() { testRequest { val client = OkHttpClient() val response = client.newCall( Request((mockServer.endpoint + "/person?name=peter").toHttpUrl()), ).execute() assertThat(response.body.string()).contains("Peter the person")
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Apr 05 03:30:42 UTC 2024 - 5.9K bytes - Viewed (0) -
okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt
fun testRequest() { serverRule.server.enqueue(MockResponse()) val call = client.newCall(Request(serverRule.server.url("/"))) call.execute().use { response -> assertThat(response.code).isEqualTo(200) } } @Test fun testRequestExternal() { assumeNetwork() val call = client.newCall(Request("https://google.com/robots.txt".toHttpUrl())) call.execute().use { response ->
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 5.7K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/Call.kt
* underlying [ResponseBody]. * * ```java * // ensure the response (and underlying response body) is closed * try (Response response = client.newCall(request).execute()) { * ... * } * ``` * * The caller may read the response body with the response's [Response.body] method. To avoid
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Dec 20 23:27:07 UTC 2023 - 3.6K bytes - Viewed (0)