Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for Trailers (0.04 sec)

  1. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

        public fun headers(headers: Headers): Builder =
          apply {
            this.headers_ = headers.newBuilder()
          }
    
        /** Sets the trailers and returns this. */
        public fun trailers(trailers: Headers): Builder =
          apply {
            this.trailers_ = trailers.newBuilder()
          }
    
        /** Don't trust the client during the SSL handshake. */
        public fun failHandshake(): Builder =
          apply {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 17.8K bytes
    - Viewed (0)
  2. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

      @JvmName("-deprecated_getTrailers")
      @Deprecated(
        message = "moved to var",
        replaceWith = ReplaceWith(expression = "trailers"),
        level = DeprecationLevel.ERROR,
      )
      fun getTrailers(): Headers = trailers
    
      fun setTrailers(trailers: Headers) = apply { this.trailers = trailers }
    
      @JvmName("-deprecated_getSocketPolicy")
      @Deprecated(
        message = "moved to var",
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat May 10 11:15:14 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/ResponseJvmTest.kt

        assertThat(response.trailers()).isEmpty()
      }
    
      @Test
      fun worksIfTrailersSet() {
        val response =
          newResponse("".toResponseBody()) {
            trailers(
              object : TrailersSource {
                override fun get() = Headers.headersOf("a", "b")
              },
            )
          }
    
        assertThat(response.trailers()["a"]).isEqualTo("b")
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 07 18:57:05 UTC 2025
    - 2.8K bytes
    - Viewed (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http2/Http2Stream.kt

        if (flushHeaders) {
          connection.flush()
        }
      }
    
      fun enqueueTrailers(trailers: Headers) {
        withLock {
          check(!sink.finished) { "already finished" }
          require(trailers.size != 0) { "trailers.size() == 0" }
          this.sink.trailers = trailers
        }
      }
    
      fun readTimeout(): Timeout = readTimeout
    
      fun writeTimeout(): Timeout = writeTimeout
    
      /**
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 07 18:57:05 UTC 2025
    - 22.4K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/TrailersTest.kt

          .build()
    
      @Test
      fun trailersHttp1() {
        trailers(Protocol.HTTP_1_1)
      }
    
      @Test
      fun trailersHttp2() {
        trailers(Protocol.HTTP_2)
      }
    
      private fun trailers(protocol: Protocol) {
        enableProtocol(protocol)
    
        server.enqueue(
          MockResponse
            .Builder()
            .addHeader("h1", "v1")
            .trailers(headersOf("t1", "v2"))
            .body(protocol, "Hello")
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 07 18:57:05 UTC 2025
    - 18K bytes
    - Viewed (0)
  6. okhttp/src/commonJvmAndroid/kotlin/okhttp3/TrailersSource.kt

     */
    package okhttp3
    
    import okio.IOException
    
    /**
     * Returns the trailers that follow an HTTP response, blocking if they aren't ready yet.
     * Implementations of this interface should respond to [Call.cancel] by immediately throwing an
     * [IOException].
     *
     * Most callers won't need this interface, and should use [Response.trailers] instead.
     *
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 07 18:57:05 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  7. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http1/Http1ExchangeCodec.kt

         */
        fun responseBodyComplete(trailers: Headers) {
          if (state == STATE_CLOSED) return
          if (state != STATE_READING_RESPONSE_BODY) throw IllegalStateException("state: $state")
    
          detachTimeout(timeout)
    
          this@Http1ExchangeCodec.trailers = trailers
          state = STATE_CLOSED
          if (trailers.size > 0) {
            client?.cookieJar?.receiveHeaders(url, trailers)
          }
        }
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 17.5K bytes
    - Viewed (0)
  8. okhttp/src/commonJvmAndroid/kotlin/okhttp3/Response.kt

       * @throws IOException if the trailers cannot be loaded, such as if the network connection is
       *     dropped.
       */
      @Throws(IOException::class)
      fun trailers(): Headers = trailersSource.get()
    
      /**
       * Returns the trailers after the HTTP response, if they are available to read immediately. Unlike
       * [trailers], this doesn't block if the trailers are not immediately available, and instead
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 14:39:28 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/HeadersRequestTest.kt

        val request =
          Request
            .Builder()
            .url("http://square.com/")
            .header("TE", "trailers")
            .build()
        val expected =
          headerEntries(
            ":method",
            "GET",
            ":path",
            "/",
            ":scheme",
            "http",
            "te",
            "trailers",
          )
        assertThat(http2HeadersList(request)).isEqualTo(expected)
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  10. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/DeprecationBridge.kt

      for (pushPromise in pushPromises) {
        result.addPush(pushPromise.wrap())
      }
    
      result.settings(settings)
      result.status(status)
      result.headers(headers)
      result.trailers(trailers)
    
      when (socketPolicy) {
        SocketPolicy.EXPECT_CONTINUE, SocketPolicy.CONTINUE_ALWAYS -> result.add100Continue()
        SocketPolicy.UPGRADE_TO_SSL_AT_END -> result.inTunnel()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 03 13:16:34 UTC 2025
    - 4.1K bytes
    - Viewed (0)
Back to top