Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 35 for body (0.2 sec)

  1. 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)
  2. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

          val client = OkHttpClient()
    
          val response =
            client.newCall(
              Request((mockServer.endpoint + "/person?name=peter").toHttpUrl()),
            ).execute()
    
          assertThat(response.body.string()).contains("Peter the person")
          assertThat(response.protocol).isEqualTo(Protocol.HTTP_1_1)
        }
      }
    
      @Test
      fun testOkHttpProxied() {
        testRequest {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  3. container-tests/src/test/java/okhttp3/containers/BasicMockServerTest.kt

            )
            .respond(response().withBody("Peter the person!"))
    
          val response = client.newCall(Request((mockServer.endpoint + "/person?name=peter").toHttpUrl())).execute()
    
          assertThat(response.body.string()).contains("Peter the person")
        }
      }
    
      @Test
      fun testHttpsRequest() {
        MockServerClient(mockServer.host, mockServer.serverPort).use { mockServerClient ->
          mockServerClient
            .`when`(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  4. 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)
  5. okhttp-coroutines/src/test/kotlin/okhttp3/SuspendCallTest.kt

        this.server = server
      }
    
      @Test
      fun suspendCall() {
        runTest {
          server.enqueue(MockResponse(body = "abc"))
    
          val call = client.newCall(request)
    
          call.executeAsync().use {
            withContext(Dispatchers.IO) {
              assertThat(it.body.string()).isEqualTo("abc")
            }
          }
        }
      }
    
      @Test
      fun timeoutCall() {
        runTest {
          server.enqueue(
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Fri Apr 05 11:25:23 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  6. okhttp-brotli/src/main/kotlin/okhttp3/brotli/internal/Uncompress.kt

        return response
      }
      val body = response.body
      val encoding = response.header("Content-Encoding") ?: return response
    
      val decompressedSource =
        when {
          encoding.equals("br", ignoreCase = true) ->
            BrotliInputStream(body.source().inputStream()).source().buffer()
          encoding.equals("gzip", ignoreCase = true) ->
            GzipSource(body.source()).buffer()
          else -> return response
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 13:19:01 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/http/RetryAndFollowUpInterceptor.kt

              }
              closeActiveExchange = false
              return response
            }
    
            val followUpBody = followUp.body
            if (followUpBody != null && followUpBody.isOneShot()) {
              closeActiveExchange = false
              return response
            }
    
            response.body.closeQuietly()
    
            if (++followUpCount > MAX_FOLLOW_UPS) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12.1K bytes
    - Viewed (4)
  8. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

        val header: String? = recordedRequest.getHeader("")
        var chunkSizes: List<Int> = recordedRequest.chunkSizes
        var bodySize: Long = recordedRequest.bodySize
        var body: Buffer = recordedRequest.body
        var utf8Body: String = recordedRequest.body.readUtf8()
        var sequenceNumber: Int = recordedRequest.sequenceNumber
        var tlsVersion: TlsVersion? = recordedRequest.tlsVersion
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  9. CHANGELOG.md

          url = "https://cash.app/".toHttpUrl(),
        )
        ```
    
     *  New: `Response.body` is now non-null. This was generally the case in OkHttp 4.x, but the Kotlin
        type declaration was nullable to support rare cases like the body on `Response.cacheResponse`,
        `Response.networkResponse`, and `Response.priorResponse`. In such cases the body is now
        non-null, but attempts to read its content will fail.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:31:39 GMT 2024
    - 21.4K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/CacheTest.kt

            .addHeader(headerName, headerValue)
            .body("a")
            .build(),
        )
        server.enqueue(
          MockResponse.Builder()
            .body("b")
            .build(),
        )
        server.enqueue(
          MockResponse.Builder()
            .body("c")
            .build(),
        )
        val url = server.url("/")
        assertThat(get(url).body.string()).isEqualTo("a")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
Back to top