Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 155 for Post (0.14 sec)

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

    import org.junit.jupiter.api.Assertions.assertTrue
    import org.junit.jupiter.api.Test
    
    @Suppress("DEPRECATION_ERROR")
    class PublicInternalApiTest {
      @Test
      fun permitsRequestBody() {
        assertTrue(permitsRequestBody("POST"))
        assertFalse(permitsRequestBody("GET"))
      }
    
      @Test
      fun requiresRequestBody() {
        assertTrue(requiresRequestBody("PUT"))
        assertFalse(requiresRequestBody("GET"))
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  2. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        // 3.5 MBytes so this test can pass on devices with little memory.
        server.bodyLimit = 7 * 512 * 1024
        val connection = server.url("/").toUrl().openConnection() as HttpURLConnection
        connection.setRequestMethod("POST")
        connection.setDoOutput(true)
        connection.setFixedLengthStreamingMode(1024 * 1024 * 1024) // 1 GB
        connection.connect()
        val out = connection.outputStream
        val data = ByteArray(1024 * 1024)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 21.9K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Cache.kt

      taskRunner: TaskRunner,
    ) : Closeable, Flushable {
      /** Create a cache of at most [maxSize] bytes in [directory]. */
      constructor(
        fileSystem: FileSystem,
        directory: Path,
        maxSize: Long,
      ) : this(
        directory,
        maxSize,
        fileSystem,
        TaskRunner.INSTANCE,
      )
    
      /** Create a cache of at most [maxSize] bytes in [directory]. */
      constructor(directory: File, maxSize: Long) : this(
    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)
  4. okhttp/src/test/java/okhttp3/EventListenerTest.kt

            .build(),
        )
        val ipAddress = InetAddress.getLoopbackAddress().hostAddress
        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/").newBuilder().host(ipAddress!!).build())
              .build(),
          )
        val response = call.execute()
        assertThat(response.code).isEqualTo(200)
        assertThat(response.body.string()).isEqualTo("abc")
        response.body.close()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 56.9K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

        }
      }
    }
    
    private fun Request.requestForCache(): Request {
      val cacheUrlOverride = cacheUrlOverride
    
      return if (cacheUrlOverride != null && (method == "GET" || method == "POST")) {
        newBuilder()
          .get()
          .url(cacheUrlOverride)
          .cacheUrlOverride(null)
          .build()
      } else {
        this
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

      @Test
      fun interruptWritingRequestBody() {
        server.enqueue(MockResponse())
        server.start()
        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/"))
              .post(
                object : RequestBody() {
                  override fun contentType() = null
    
                  override fun writeTo(sink: BufferedSink) {
                    for (i in 0..9) {
                      sink.writeByte(0)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/RequestBody.kt

       *
       * [grpc]: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
       */
      open fun isDuplex(): Boolean = commonIsDuplex()
    
      /**
       * Returns true if this body expects at most one call to [writeTo] and can be transmitted
       * at most once. This is typically used when writing the request body is destructive and it is not
       * possible to recreate the request body after it has been sent.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Jan 25 14:41:37 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

                },
            ),
          )
        val response = call.execute()
        assertThat(response.body.string()).isEqualTo("ABCDE")
        val request = server.takeRequest()
        assertThat(request.requestLine).isEqualTo("POST /foo HTTP/1.1")
        assertArrayEquals(postBytes, request.body.readByteArray())
        assertThat(request.headers["Content-Length"]).isNull()
      }
    
      @ParameterizedTest
      @ArgumentsSource(ProtocolParamProvider::class)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  9. CHANGELOG.md

        irrelevant data.
    
        This feature may be used with `POST` requests to cache their responses. In such cases the
        request body is not used to determine the cache key, so you must manually add cache-relevant
        data to the override URL. For example, you could add a `request-body-sha256` query parameter so
        requests with the same POST data get the same cache entry.
    
    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

      fun requestMethodPostIsNotCached() {
        // We could support this but choose not to for implementation simplicity
        testRequestMethod("POST", false)
      }
    
      @Test
      fun requestMethodPostIsNotCachedUnlessOverridden() {
        // Supported via cacheUrlOverride
        testRequestMethod("POST", true, withOverride = true)
      }
    
      @Test
      fun requestMethodPutIsNotCached() {
        testRequestMethod("PUT", false)
      }
    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