Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for requiresRequestBody (0.19 sec)

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

      @Test
      fun permitsRequestBody() {
        assertTrue(permitsRequestBody("POST"))
        assertFalse(permitsRequestBody("GET"))
      }
    
      @Test
      fun requiresRequestBody() {
        assertTrue(requiresRequestBody("PUT"))
        assertFalse(requiresRequestBody("GET"))
      }
    
      @Test
      fun hasBody() {
        val request = Request.Builder().url("http://example.com").build()
        val response =
          Response.Builder().code(200)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http/HttpMethod.kt

          method == "POST" || method == "PATCH" || method == "PUT" ||
            method == "DELETE" || method == "MOVE"
        )
    
      @JvmStatic // Despite being 'internal', this method is called by popular 3rd party SDKs.
      fun requiresRequestBody(method: String): Boolean =
        (
          method == "POST" || method == "PUT" ||
            method == "PATCH" || method == "PROPPATCH" || // WebDAV
            method == "REPORT"
        )
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/-RequestCommon.kt

      method: String,
      body: RequestBody?,
    ): Request.Builder =
      apply {
        require(method.isNotEmpty()) {
          "method.isEmpty() == true"
        }
        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."
          }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.1K bytes
    - Viewed (0)
Back to top