- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 50 for body (0.15 sec)
-
okhttp/src/test/java/okhttp3/RequestTest.kt
assertThat(body.contentLength()).isEqualTo(3) assertThat(bodyToHex(body)).isEqualTo("616263") assertThat(bodyToHex(body), "Retransmit body").isEqualTo("616263") } @Test fun byteArrayRange() { val contentType = "text/plain".toMediaType() val body: RequestBody = ".abcd".toByteArray().toRequestBody(contentType, 1, 3) assertThat(body.contentType()).isEqualTo(contentType)
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 16.4K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/tls/ClientAuthTest.kt
assertThat(response.body.string()).isEqualTo("abc") } @Test fun clientAuthForNeeds() { val client = buildClient(clientCert, clientIntermediateCa.certificate) val socketFactory = buildServerSslSocketFactory() server.useHttps(socketFactory) server.requireClientAuth() server.enqueue( MockResponse.Builder() .body("abc") .build(), )
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun Jan 14 10:20:09 GMT 2024 - 12.5K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/ResponseBody.kt
* closes its response body. If you invoke [Call.execute] or implement [Callback.onResponse] you * must close this body by calling any of the following methods: * * * `Response.close()` * * `Response.body().close()` * * `Response.body().source().close()` * * `Response.body().charStream().close()` * * `Response.body().byteStream().close()` * * `Response.body().bytes()` * * `Response.body().string()` *
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 10.7K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/Request.kt
open fun head(): Builder = commonHead() open fun post(body: RequestBody): Builder = commonPost(body) @JvmOverloads open fun delete(body: RequestBody? = commonEmptyRequestBody): Builder = commonDelete(body) open fun put(body: RequestBody): Builder = commonPut(body) open fun patch(body: RequestBody): Builder = commonPatch(body) open fun method( method: String,
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Apr 06 04:17:44 GMT 2024 - 10.5K bytes - Viewed (0) -
android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt
enableTls() client = client.newBuilder().eventListenerFactory(clientTestRule.wrap(eventListener)).build() server.enqueue(MockResponse(body = "abc1")) server.enqueue(MockResponse(body = "abc2")) val request = Request.Builder().url(server.url("/")).build() client.newCall(request).execute().use { response -> assertEquals(200, response.code) }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Jan 20 10:30:28 GMT 2024 - 27K bytes - Viewed (1) -
okhttp/src/test/java/okhttp3/FastFallbackTest.kt
localhostIpv4, localhostIpv6, ) serverIpv4.enqueue( MockResponse(body = "unexpected call to IPv4"), ) serverIpv6.enqueue( MockResponse(body = "hello from IPv6"), ) val call = client.newCall(Request(url)) val response = call.execute() assertThat(response.body.string()).isEqualTo("hello from IPv6") // In the process we made one successful connection attempt.
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 10.3K bytes - Viewed (0) -
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/main/kotlin/okhttp3/Cache.kt
private inner class RealCacheRequest( private val editor: DiskLruCache.Editor, ) : CacheRequest { private val cacheOut: Sink = editor.newSink(ENTRY_BODY) private val body: Sink var done = false init { this.body = object : ForwardingSink(cacheOut) { @Throws(IOException::class) override fun close() { synchronized(this@Cache) {
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Wed Apr 10 19:46:48 GMT 2024 - 26.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)