Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 376 for text (0.22 sec)

  1. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

          )
        serverWriter.writeMessageFrame(OPCODE_TEXT, "Hello".encodeUtf8())
        assertData("c107f248cdc9c90700")
      }
    
      @Test fun serverSmallBufferedPayloadWrittenAsOneFrame() {
        val length = 5
        val payload: ByteString = (binaryData(length))
        serverWriter.writeMessageFrame(OPCODE_TEXT, payload)
        assertData("8105")
        assertData(payload)
      }
    
      @Test fun serverLargeBufferedPayloadWrittenAsOneFrame() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  2. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

        if (path.endsWith(".jpg")) return "image/jpeg";
        if (path.endsWith(".jpeg")) return "image/jpeg";
        if (path.endsWith(".gif")) return "image/gif";
        if (path.endsWith(".html")) return "text/html; charset=utf-8";
        if (path.endsWith(".txt")) return "text/plain; charset=utf-8";
        return "application/octet-stream";
      }
    
      public static void main(String[] args) throws Exception {
        if (args.length != 4) {
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

            }
          }
        body.byteStream().close()
        assertThat(closed.get()).isTrue()
      }
    
      @Test
      fun unicodeTextWithUnsupportedEncoding() {
        val text = "eile oli oliiviõli"
        val body = text.toResponseBody("text/plain; charset=unknown".toMediaType())
        assertThat(body.string()).isEqualTo(text)
      }
    
      companion object {
        @JvmOverloads
        fun body(
          hex: String,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  4. samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt

      @AfterEach fun tearDown() {
        httpClient.close()
      }
    
      @Test fun get(server: MockWebServer) {
        server.enqueue(
          MockResponse.Builder()
            .body("hello, Apache HttpClient 5.x")
            .build(),
        )
    
        val request = HttpGet(server.url("/").toUri())
        request.addHeader("Accept", "text/plain")
    
        httpClient.execute(request).use { response ->
          assertThat(response.code).isEqualTo(200)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  5. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

           *
           * Example:
           * ```
           * --> POST /greeting http/1.1
           * Host: example.com
           * Content-Type: plain/text
           * Content-Length: 3
           * --> END POST
           *
           * <-- 200 OK (22ms)
           * Content-Type: plain/text
           * Content-Length: 6
           * <-- END HTTP
           * ```
           */
          HEADERS,
    
          /**
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  6. samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt

    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.extension.RegisterExtension
    
    /**
     * Java HTTP Client.
     *
     * https://openjdk.java.net/groups/net/httpclient/intro.html
     *
     * Baseline test if we ned to validate OkHttp behaviour against other popular clients.
     */
    class JavaHttpClientTest {
      @JvmField @RegisterExtension
      val platform = PlatformRule()
    
      @Test fun get(server: MockWebServer) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  7. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSources.kt

        return EventSource.Factory { request, listener ->
          val actualRequest =
            if (request.header("Accept") == null) {
              request.newBuilder().addHeader("Accept", "text/event-stream").build()
            } else {
              request
            }
    
          RealEventSource(actualRequest, listener).apply {
            connect(callFactory)
          }
        }
      }
    
      @JvmStatic
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 04:18:15 GMT 2024
    - 1.6K bytes
    - Viewed (1)
  8. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

          assertThat(requestBody.contentType()).isNull()
        }
      }
    
      @Test
      fun testFileDescriptorMediaType() {
        assertOnFileDescriptor { fd ->
          val contentType = "text/plain".toMediaType()
    
          val requestBody = fd.toRequestBody(contentType)
    
          assertThat(requestBody.contentType()).isEqualTo(contentType)
        }
      }
    
      @Test
      fun testFileDescriptorReadTwice() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (1)
  9. samples/guide/src/main/java/okhttp3/recipes/PostFile.java

    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public final class PostFile {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        File file = new File("README.md");
    
        Request request = new Request.Builder()
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    import okio.BufferedSink;
    
    public final class PostStreaming {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        RequestBody requestBody = new RequestBody() {
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 2.1K bytes
    - Viewed (0)
Back to top