- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 116 for body (0.17 sec)
-
okhttp/src/test/java/okhttp3/InterceptorTest.kt
MockResponse.Builder() .body("abc") .throttleBody(1, 1, TimeUnit.SECONDS) .build(), ) val request1 = Request.Builder() .url(server.url("/")) .build() val call = client.newCall(request1) val response = call.execute() val body = response.body assertFailsWith<SocketTimeoutException> { body.string() } } @Test
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun Jan 14 10:20:09 GMT 2024 - 27.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt
MockResponse.Builder() .body(BIG_ENOUGH_BODY) .build(), ) val request = Request.Builder() .url(server.url("/")) .build() val call = client.newCall(request) call.timeout().timeout(250, TimeUnit.MILLISECONDS) val response = call.execute() Thread.sleep(500) assertFailsWith<IOException> { response.body.source().readUtf8() }.also { expected ->
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 10.5K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt
cacheRequest: CacheRequest?, response: Response, ): Response { // Some apps return a null body; for compatibility we treat that like a null cache request. if (cacheRequest == null) return response val cacheBodyUnbuffered = cacheRequest.body() val source = response.body.source() val cacheBody = cacheBodyUnbuffered.buffer() val cacheWritingSource = object : Source {
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Fri Mar 22 07:09:21 GMT 2024 - 10.2K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/MultipartBody.kt
level = DeprecationLevel.ERROR, ) fun body(): RequestBody = body companion object { @JvmStatic fun create(body: RequestBody): Part = create(null, body) @JvmStatic fun create( headers: Headers?, body: RequestBody, ): Part { require(headers?.get("Content-Type") == null) { "Unexpected header: Content-Type" }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 10.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt
@Test @Throws(IOException::class) fun non101RetainsBody() { webServer.enqueue( MockResponse.Builder() .code(200) .body("Body") .build(), ) newWebSocket() clientListener.assertFailure( 200, "Body", ProtocolException::class.java, "Expected HTTP 101 response but was '200 OK'", ) } @Test @Throws(IOException::class)
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun Mar 31 17:16:15 GMT 2024 - 35.2K bytes - Viewed (1) -
okhttp/src/test/java/okhttp3/ConnectionReuseTest.kt
val response2 = client.newCall(request).execute() response1.body.string() // Discard the response body. response2.body.string() // Discard the response body. assertThat(server.takeRequest().sequenceNumber).isEqualTo(0) assertThat(server.takeRequest().sequenceNumber).isEqualTo(1) } @Test fun connectionsAreEvicted() { server.enqueue(MockResponse(body = "a")) server.enqueue(MockResponse(body = "b"))
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 12.3K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/RouteFailureTest.kt
val refusedStream = MockResponse( socketPolicy = ResetStreamAtStart(ErrorCode.REFUSED_STREAM.httpCode), ) val bodyResponse = MockResponse(body = "body") @BeforeEach fun setUp( server: MockWebServer, @MockWebServerInstance("server2") server2: MockWebServer, ) { this.server1 = server this.server2 = server2
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Jan 20 10:30:28 GMT 2024 - 11.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt
fun multipartBodyPart() { val multipartBody: MultipartBody = MultipartBody.Builder().build() val part: MultipartBody.Part = multipartBody.part(0) val headers: Headers? = part.headers() val body: RequestBody = part.body() } @Test @Disabled fun okHttpClient() { val client = OkHttpClient() val dispatcher: Dispatcher = client.dispatcher() val proxy: Proxy? = client.proxy()
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 13.3K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/DuplexTest.kt
requestBody2.writeUtf8("request body\n") requestBody2.close() val responseBody2 = response2.body.source() assertThat(responseBody2.readUtf8Line()) .isEqualTo("response body") assertTrue(responseBody2.exhausted()) body.awaitSuccess() // No more requests attempted! (call.request().body as AsyncRequestBody?)!!.assertNoMoreSinks() }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Jan 20 10:30:28 GMT 2024 - 23.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt
class ResponseBodyJvmTest { @Test fun stringEmpty() { val body = body("") assertThat(body.string()).isEqualTo("") } @Test fun stringLooksLikeBomButTooShort() { val body = body("000048") assertThat(body.string()).isEqualTo("\u0000\u0000H") } @Test fun stringDefaultsToUtf8() { val body = body("68656c6c6f") assertThat(body.string()).isEqualTo("hello") } @Test
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 13K bytes - Viewed (0)