Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 100 for example (0.19 sec)

  1. okhttp/src/main/kotlin/okhttp3/EventListener.kt

       * example, thread A may be executing [responseBodyStart] while thread B executes [canceled].
       * Implementations must support such concurrent calls.
       *
       * Note that cancellation is best-effort and that a call may proceed normally after it has been
       * canceled. For example, happy-path events like [requestHeadersStart] and [requestHeadersEnd] may
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15.2K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/UrlComponentEncodingTester.kt

        open fun encode(codePoint: Int): String {
          throw UnsupportedOperationException()
        }
      }
    
      enum class Component {
        USER {
          override fun urlString(value: String): String = "http://$value@example.com/"
    
          override fun encodedValue(url: HttpUrl): String = url.encodedUsername
    
          override operator fun set(
            builder: HttpUrl.Builder,
            value: String,
          ) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/guide/GetExample.java

        try (Response response = client.newCall(request).execute()) {
          return response.body().string();
        }
      }
    
      public static void main(String[] args) throws IOException {
        GetExample example = new GetExample();
        String response = example.run("https://raw.github.com/square/okhttp/master/README.md");
        System.out.println(response);
      }
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/WebPlatformToAsciiTest.kt

          // OkHttp doesn't reject U+FFFD encoded in Punycode.
          "xn--zn7c.com",
          // OkHttp doesn't reject a U+200D. https://www.rfc-editor.org/rfc/rfc5892.html#appendix-A.2
          "xn--1ug.example",
          // OkHttp doesn't implement CheckJoiners.
          "\u200D.example",
          // OkHttp doesn't implement CheckBidi.
          "يa",
        )
    
      @Test
      fun test() {
        val list = WebPlatformToAsciiData.load()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  5. okhttp-brotli/src/test/java/okhttp3/brotli/BrotliBombTest.kt

      @Test
      fun testDecompressBomb() {
        val response =
          Response.Builder()
            .code(200)
            .message("OK")
            .header("Content-Encoding", "br")
            .request(Request.Builder().url("https://example.com/").build())
            .body(readBrotli10G().toResponseBody())
            .protocol(Protocol.HTTP_2)
            .build()
    
        val uncompressed = uncompress(response)
    
        assertFailure {
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 29 22:50:20 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/kt/WiresharkExample.kt

        }
      }
    }
    
    fun main() {
      // Call this before anything else initialises the JSSE stack.
      WireSharkListenerFactory.register()
    
      val example = WiresharkExample(tlsVersions = listOf(TLS_1_2), launch = CommandLine)
      example.run()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.7K bytes
    - Viewed (1)
  7. docs/features/https.md

           */
          private fun trustedCertificatesInputStream(): InputStream {
            ... // Full source omitted. See sample.
          }
    
          private fun trustManagerForCertificates(inputStream: InputStream): X509TrustManager {
            ... // Full source omitted. See sample.
          }
        ```
    === ":material-language-java: Java"
        ```java
          private final OkHttpClient client;
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Dec 24 00:16:30 GMT 2022
    - 10.5K bytes
    - Viewed (0)
  8. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

      }
    
      /** A call that keeps track of whether its response body is closed. */
      private class ClosableCall : FailingCall() {
        private val response =
          Response.Builder()
            .request(Request("https://example.com/".toHttpUrl()))
            .protocol(Protocol.HTTP_1_1)
            .message("OK")
            .code(200)
            .body(
              object : ResponseBody() {
                override fun contentType() = null
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixDatabaseTest.kt

        checkPublicSuffix("example.com", "example.com")
        checkPublicSuffix("b.example.com", "example.com")
        checkPublicSuffix("a.b.example.com", "example.com")
        checkPublicSuffix("uk.com", null)
        checkPublicSuffix("example.uk.com", "example.uk.com")
        checkPublicSuffix("b.example.uk.com", "example.uk.com")
        checkPublicSuffix("a.b.example.uk.com", "example.uk.com")
        checkPublicSuffix("test.ac", "test.ac")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.3K bytes
    - Viewed (0)
  10. okcurl/src/test/kotlin/okhttp3/curl/MainTest.kt

      @Test
      fun simple() {
        val request = fromArgs("http://example.com").createRequest()
        assertThat(request.method).isEqualTo("GET")
        assertThat(request.url.toString()).isEqualTo("http://example.com/")
        assertThat(request.body).isNull()
      }
    
      @Test
      @Throws(IOException::class)
      fun put() {
        val request = fromArgs("-X", "PUT", "-d", "foo", "http://example.com").createRequest()
        assertThat(request.method).isEqualTo("PUT")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.3K bytes
    - Viewed (0)
Back to top