Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for permitsRequestBody (0.19 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/PublicInternalApiTest.kt

    import okhttp3.internal.http.HttpMethod.permitsRequestBody
    import okhttp3.internal.http.HttpMethod.requiresRequestBody
    import okhttp3.internal.http.hasBody
    import org.junit.jupiter.api.Assertions.assertFalse
    import org.junit.jupiter.api.Assertions.assertTrue
    import org.junit.jupiter.api.Test
    
    @Suppress("DEPRECATION_ERROR")
    class PublicInternalApiTest {
      @Test
      fun permitsRequestBody() {
        assertTrue(permitsRequestBody("POST"))
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  2. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http/HttpMethod.kt

            method == "PATCH" ||
            method == "PROPPATCH" ||
            // WebDAV
            method == "REPORT"
        )
    
      @JvmStatic // Despite being 'internal', this method is called by popular 3rd party SDKs.
      fun permitsRequestBody(method: String): Boolean = !(method == "GET" || method == "HEAD")
    
      fun redirectsWithBody(method: String): Boolean = method == "PROPFIND"
    
      fun redirectsToGet(method: String): Boolean = method != "PROPFIND"
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http/CallServerInterceptor.kt

        var invokeStartEvent = true
        var responseBuilder: Response.Builder? = null
        var sendRequestException: IOException? = null
        val hasRequestBody = HttpMethod.permitsRequestBody(request.method) && requestBody != null
        val isUpgradeRequest =
          !hasRequestBody &&
            "upgrade".equals(request.header("Connection"), ignoreCase = true)
        try {
          exchange.writeRequestHeaders(request)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 22:04:11 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  4. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

              peek.doNotReadRequestBody -> {
                hasBody = false // Ignore the body completely.
              }
    
              contentLength != -1L -> {
                hasBody = contentLength > 0L || HttpMethod.permitsRequestBody(request.method)
                requestBodySink.write(socket.source, contentLength)
              }
    
              chunked -> {
                chunkSizes = mutableListOf()
                hasBody = true
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 02 20:36:00 UTC 2025
    - 40.3K bytes
    - Viewed (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http/RetryAndFollowUpInterceptor.kt

        if (!sameScheme && !client.followSslRedirects) return null
    
        // Most redirects don't include a request body.
        val requestBuilder = userResponse.request.newBuilder()
        if (HttpMethod.permitsRequestBody(method)) {
          val responseCode = userResponse.code
          val maintainBody =
            HttpMethod.redirectsWithBody(method) ||
              responseCode == HTTP_PERM_REDIRECT ||
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:58:02 UTC 2025
    - 12.4K bytes
    - Viewed (0)
  6. okhttp/src/commonJvmAndroid/kotlin/okhttp3/Request.kt

            if (body == null) {
              require(!HttpMethod.requiresRequestBody(method)) {
                "method $method must have a request body."
              }
            } else {
              require(HttpMethod.permitsRequestBody(method)) {
                "method $method must not have a request body."
              }
            }
            this.method = method
            this.body = body
          }
    
        /**
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 16 09:39:51 UTC 2025
    - 13.1K bytes
    - Viewed (1)
  7. okhttp/src/androidMain/baseline-prof.txt

    HSPLokhttp3/internal/http/HttpHeaders;->promisesBody(Lokhttp3/Response;)Z
    HSPLokhttp3/internal/http/HttpHeaders;->receiveHeaders(Lokhttp3/CookieJar;Lokhttp3/HttpUrl;Lokhttp3/Headers;)V
    HSPLokhttp3/internal/http/HttpMethod;->permitsRequestBody(Ljava/lang/String;)Z
    HSPLokhttp3/internal/http/RealInterceptorChain;-><init>(Lokhttp3/internal/connection/RealCall;Ljava/util/List;ILokhttp3/internal/connection/Exchange;Lokhttp3/Request;III)V
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Dec 30 23:28:56 UTC 2024
    - 127.9K bytes
    - Viewed (0)
Back to top