Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 115 for texts (0.15 sec)

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

      fun getContentTypeConnects() {
        server.enqueue(
          MockResponse(
            headers = headersOf("Content-Type", "text/plain"),
            body = "ABC",
          ),
        )
        val response = getResponse(newRequest("/"))
        assertThat(response.body.contentType()).isEqualTo(
          "text/plain".toMediaType(),
        )
        response.body.close()
      }
    
      @Test
      fun getContentEncodingConnects() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  2. mockwebserver/README.md

      RecordedRequest request3 = server.takeRequest();
      assertEquals("/v1/chat/messages/3", request3.getPath());
    
      // Shut down the server. Instances cannot be reused.
      server.shutdown();
    }
    ```
    
    Your unit tests might move the `server` into a field so you can shut it down
    from your test's `tearDown()`.
    
    ### API
    
    #### MockResponse
    
    Mock responses default to an empty response body and a `200` status code.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  3. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

    import assertk.assertions.isFalse
    import assertk.assertions.isNull
    import assertk.assertions.isTrue
    import java.math.BigInteger
    import java.net.InetAddress
    import java.net.ProtocolException
    import java.text.SimpleDateFormat
    import java.util.Date
    import java.util.TimeZone
    import kotlin.test.assertFailsWith
    import okhttp3.tls.internal.der.CertificateAdapters.generalNameDnsName
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  4. docs/changelogs/changelog_4x.md

        The upcoming Android Studio runs in a JVM but has classes from Android and that confused OkHttp!
    
     *  Fix: Include the header `Accept: text/event-stream` for SSE calls. This header is not added if
        the request already contains an `Accept` header.
    
     *  Fix: Don't crash with a `NullPointerException` if a server sends a close while we're sending a
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/HttpUrlTest.kt

        // ideographic space
        assertThat(parse("http://h/\u3000").encodedPath).isEqualTo("/%E3%80%80")
      }
    
      @Test
      fun newBuilderResolve() {
        // Non-exhaustive tests because implementation is the same as resolve.
        val base = parse("http://host/a/b")
        assertThat(base.newBuilder("https://host2")!!.build())
          .isEqualTo(parse("https://host2/"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 67.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/CallTest.kt

        server.enqueue(MockResponse())
        assertFailsWith<IllegalArgumentException> {
          Request.Builder().method("GET", "abc".toRequestBody("text/plain".toMediaType()))
        }
      }
    
      @Test
      fun head() {
        server.enqueue(
          MockResponse(
            headers = headersOf("Content-Type", "text/plain"),
          ),
        )
        val request =
          Request.Builder()
            .url(server.url("/"))
            .head()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/MediaTypeJvmTest.kt

      @Test fun testIllegalCharsetName() {
        val mediaType = parse("text/plain; charset=\"!@#$%^&*()\"")
        assertNull(mediaType.charsetName())
      }
    
      @Test fun testUnsupportedCharset() {
        val mediaType = parse("text/plain; charset=utf-wtf")
        assertNull(mediaType.charsetName())
      }
    
      @Test fun testCharsetNameIsDoubleQuotedAndSingleQuoted() {
        val mediaType = parse("text/plain;charset=\"'utf-8'\"")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3K bytes
    - Viewed (0)
  8. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

          .assertLogEqual("Content-Type: text/plain; charset=utf-8")
          .assertLogEqual("--> END POST")
          .assertLogMatch(Regex("""<-- 200 OK $url \(\d+ms\)"""))
          .assertLogEqual("Content-Length: 0")
          .assertLogEqual("<-- END HTTP")
          .assertNoMoreLogs()
        networkLogs
          .assertLogEqual("--> POST $url http/1.1")
          .assertLogEqual("Content-Type: text/plain; charset=utf-8")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/ws/WebSocketRecorder.kt

        }
      }
    
      override fun onMessage(
        webSocket: WebSocket,
        text: String,
      ) {
        Platform.get().log("[WS $name] onMessage", Platform.INFO, null)
        val delegate = delegate
        if (delegate != null) {
          this.delegate = null
          delegate.onMessage(webSocket, text)
        } else {
          events.add(Message(string = text))
        }
      }
    
      override fun onClosing(
        webSocket: WebSocket,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  10. okhttp-testing-support/src/main/kotlin/okhttp3/TestValueFactory.kt

    import okhttp3.tls.internal.TlsUtil.localhost
    
    /**
     * OkHttp is usually tested with functional tests: these use public APIs to confirm behavior against
     * MockWebServer. In cases where logic is particularly tricky, we use unit tests. This class makes
     * it easy to get sample values to use in such tests.
     *
     * This class is pretty fast and loose with default values: it attempts to provide values that are
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 7.7K bytes
    - Viewed (0)
Back to top