Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

              """.trimMargin(),
            )
            .setHeader("content-type", "text/event-stream")
            .build(),
        )
        newEventSource("text/plain")
        listener.assertOpen()
        listener.assertEvent(null, null, "hey")
        listener.assertClose()
        assertThat(server.takeRequest().headers["Accept"]).isEqualTo("text/plain")
      }
    
      @Test
      fun setsMissingAccept() {
        server.enqueue(
          MockResponse.Builder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/AutobahnTester.kt

        newWebSocket(
          "/getCaseCount",
          object : WebSocketListener() {
            override fun onMessage(
              webSocket: WebSocket,
              text: String,
            ) {
              countRef.set(text.toLong())
            }
    
            override fun onClosing(
              webSocket: WebSocket,
              code: Int,
              reason: String,
            ) {
    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)
  3. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketReader.kt

        @Throws(IOException::class)
        fun onReadMessage(text: String)
    
        @Throws(IOException::class)
        fun onReadMessage(bytes: ByteString)
    
        fun onReadPing(payload: ByteString)
    
        fun onReadPong(payload: ByteString)
    
        fun onReadClose(
          code: Int,
          reason: String,
        )
      }
    
      /**
       * Process the next protocol frame.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  4. samples/compare/src/test/kotlin/okhttp3/compare/OkHttpClientTest.kt

          Request.Builder()
            .url(server.url("/"))
            .header("Accept", "text/plain")
            .build()
        val response = client.newCall(request).execute()
        assertThat(response.code).isEqualTo(200)
        assertThat(response.body.string()).isEqualTo("hello, OkHttp")
    
        val recorded = server.takeRequest()
        assertThat(recorded.headers["Accept"]).isEqualTo("text/plain")
        assertThat(recorded.headers["Accept-Encoding"]).isEqualTo("gzip")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  5. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  6. samples/slack/src/main/java/okhttp3/slack/RtmSession.java

        System.out.println("onOpen: " + response);
      }
    
      // TOOD(jwilson): decode incoming messages and dispatch them somewhere.
      @Override public void onMessage(WebSocket webSocket, String text) {
        System.out.println("onMessage: " + text);
      }
    
      @Override public void onClosing(WebSocket webSocket, int code, String reason) {
        webSocket.close(1000, null);
        System.out.println("onClose (" + code + "): " + reason);
      }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Nov 19 20:16:58 GMT 2016
    - 2.4K bytes
    - Viewed (0)
  7. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  8. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  9. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  10. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
Back to top