Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for clearHeaders (0.1 sec)

  1. okhttp/src/test/java/okhttp3/DuplexTest.kt

            .receiveRequest("request E\n")
            .sendResponse("response F\n")
            .exhaustRequest()
            .exhaustResponse()
        server.enqueue(
          MockResponse.Builder()
            .clearHeaders()
            .streamHandler(body)
            .build(),
        )
        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/"))
              .post(AsyncRequestBody())
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  2. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        val response =
          MockResponse()
            .clearHeaders()
            .addHeader("Cookie: s=square")
            .addHeader("Cookie", "a=android")
        assertThat(headersToList(response))
          .containsExactly("Cookie: s=square", "Cookie: a=android")
      }
    
      @Test
      fun mockResponseSetHeader() {
        val response =
          MockResponse()
            .clearHeaders()
            .addHeader("Cookie: s=square")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  3. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        val builder =
          MockResponse.Builder()
            .clearHeaders()
            .addHeader("Cookie: s=square")
            .addHeader("Cookie", "a=android")
        assertThat(headersToList(builder)).containsExactly("Cookie: s=square", "Cookie: a=android")
      }
    
      @Test
      fun mockResponseSetHeader() {
        val builder =
          MockResponse.Builder()
            .clearHeaders()
            .addHeader("Cookie: s=square")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 23.5K bytes
    - Viewed (0)
  4. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

        mockResponse.status = ""
        mockResponse = mockResponse.setResponseCode(0)
        var headers: Headers = mockResponse.headers
        var trailers: Headers = mockResponse.trailers
        mockResponse = mockResponse.clearHeaders()
        mockResponse = mockResponse.addHeader("")
        mockResponse = mockResponse.addHeader("", "")
        mockResponse = mockResponse.addHeaderLenient("", Any())
        mockResponse = mockResponse.setHeader("", Any())
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  5. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

            in 400..499 -> "Client Error"
            in 500..599 -> "Server Error"
            else -> "Mock Response"
          }
        return apply { status = "HTTP/1.1 $code $reason" }
      }
    
      fun clearHeaders() =
        apply {
          headersBuilder = Headers.Builder()
        }
    
      fun addHeader(header: String) =
        apply {
          headersBuilder.add(header)
        }
    
      fun addHeader(
        name: String,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/CallTest.kt

      fun tearDown() {
        cache.close()
        fileSystem.checkNoOpenFiles()
      }
    
      @Test
      fun get() {
        server.enqueue(
          MockResponse.Builder()
            .body("abc")
            .clearHeaders()
            .addHeader("content-type: text/plain")
            .addHeader("content-length", "3")
            .build(),
        )
        val sentAt = System.currentTimeMillis()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 142.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

            .body("5;x\r\nABCDE\r\n0\r\n\r\n")
            .clearHeaders()
            .addHeader("Transfer-encoding: chunked")
            .build(),
        )
        getResponse(newRequest("/")).use { response -> assertContent("ABCDE", response) }
      }
    
      @Test
      fun missingChunkBody() {
        server.enqueue(
          MockResponse.Builder()
            .body("5")
            .clearHeaders()
            .addHeader("Transfer-encoding: chunked")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 131.7K bytes
    - Viewed (0)
  8. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

            this.status = status
          }
    
        /**
         * Removes all HTTP headers including any "Content-Length" and "Transfer-encoding" headers that
         * were added by default.
         */
        fun clearHeaders() =
          apply {
            headers = Headers.Builder()
          }
    
        /**
         * Adds [header] as an HTTP header. For well-formed HTTP [header] should contain a name followed
         * by a colon and a value.
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 23 14:31:42 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/ConnectionReuseTest.kt

        assertConnectionNotReused(requestA, requestB)
      }
    
      @Test
      fun connectionsAreNotReusedWithUnknownLengthResponseBody() {
        server.enqueue(
          MockResponse.Builder()
            .body("a")
            .clearHeaders()
            .socketPolicy(DisconnectAtEnd)
            .build(),
        )
        server.enqueue(MockResponse(body = "b"))
        val request = Request(server.url("/"))
        assertConnectionNotReused(request, request)
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/CacheTest.kt

          MockResponse.Builder()
            .body("A")
            .addHeader("Expires: " + formatDate(1, TimeUnit.HOURS))
            .build(),
        )
        server.enqueue(
          MockResponse.Builder()
            .clearHeaders()
            .code(HttpURLConnection.HTTP_NO_CONTENT)
            .build(),
        )
        server.enqueue(
          MockResponse.Builder()
            .body("C")
            .build(),
        )
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 108.6K bytes
    - Viewed (0)
Back to top