Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for Nelson (0.27 sec)

  1. container-tests/src/test/java/okhttp3/containers/SocksProxyTest.kt

        MockServerClient(mockServer.host, mockServer.serverPort).use { mockServerClient ->
          mockServerClient
            .`when`(
              request().withPath("/person")
                .withQueryStringParameter("name", "peter"),
            )
            .respond(response().withBody("Peter the person!"))
    
          val client =
            OkHttpClient.Builder()
              .proxy(Proxy(SOCKS, InetSocketAddress(socks5Proxy.host, socks5Proxy.firstMappedPort)))
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  2. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

              Request((mockServer.secureEndpoint + "/person?name=peter").toHttpUrl()),
            ).execute()
    
          assertThat(response.body.string()).contains("Peter the person")
          assertThat(response.protocol).isEqualTo(Protocol.HTTP_1_1)
        }
      }
    
      @Test
      fun testUrlConnectionDirect() {
        testRequest {
          val url = URI(mockServer.endpoint + "/person?name=peter").toURL()
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/ws/WebSocketRecorder.kt

        assertThat(nextEvent()).isEqualTo(Pong(payload))
      }
    
      fun assertClosing(
        code: Int,
        reason: String,
      ) {
        assertThat(nextEvent()).isEqualTo(Closing(code, reason))
      }
    
      fun assertClosed(
        code: Int,
        reason: String,
      ) {
        assertThat(nextEvent()).isEqualTo(Closed(code, reason))
      }
    
      fun assertExhausted() {
        assertThat(events).isEmpty()
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  4. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

          }
          set(value) {
            val reason =
              when (value) {
                in 100..199 -> "Informational"
                in 200..299 -> "OK"
                in 300..399 -> "Redirection"
                in 400..499 -> "Client Error"
                in 500..599 -> "Server Error"
                else -> "Mock Response"
              }
            status = "HTTP/1.1 $value $reason"
          }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 13.3K bytes
    - Viewed (1)
  5. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

            .addInterceptor(applicationInterceptor)
            .build()
        try {
          client.newCall(request().build()).execute()
          fail<Any>()
        } catch (expected: UnknownHostException) {
        }
        applicationLogs
          .assertLogEqual("--> GET $url")
          .assertLogEqual("<-- HTTP FAILED: java.net.UnknownHostException: reason")
          .assertNoMoreLogs()
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/ws/RealWebSocket.kt

      override fun close(
        code: Int,
        reason: String?,
      ): Boolean {
        return close(code, reason, webSocketCloseTimeout)
      }
    
      @Synchronized fun close(
        code: Int,
        reason: String?,
        cancelAfterCloseMillis: Long,
      ): Boolean {
        validateCloseCode(code)
    
        var reasonBytes: ByteString? = null
        if (reason != null) {
          reasonBytes = reason.encodeUtf8()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 22.1K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

        System.out.println("MESSAGE: " + bytes.hex());
      }
    
      @Override public void onClosing(WebSocket webSocket, int code, String reason) {
        webSocket.close(1000, null);
        System.out.println("CLOSE: " + code + " " + reason);
      }
    
      @Override public void onFailure(WebSocket webSocket, Throwable t, Response response) {
        t.printStackTrace();
      }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 04 11:40:21 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/WebSocketListener.kt

        webSocket: WebSocket,
        code: Int,
        reason: String,
      ) {
      }
    
      /**
       * Invoked when both peers have indicated that no more messages will be transmitted and the
       * connection has been successfully released. No further calls to this listener will be made.
       */
      open fun onClosed(
        webSocket: WebSocket,
        code: Int,
        reason: String,
      ) {
      }
    
      /**
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2K bytes
    - Viewed (0)
  9. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

      fun setResponseCode(code: Int): MockResponse {
        val reason =
          when (code) {
            in 100..199 -> "Informational"
            in 200..299 -> "OK"
            in 300..399 -> "Redirection"
            in 400..499 -> "Client Error"
            in 500..599 -> "Server Error"
            else -> "Mock Response"
          }
        return apply { status = "HTTP/1.1 $code $reason" }
      }
    
      fun clearHeaders() =
        apply {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  10. okhttp-logging-interceptor/src/test/java/okhttp3/logging/LoggingEventListenerTest.kt

          .assertLogMatch(Regex("""callEnd"""))
          .assertNoMoreLogs()
      }
    
      @Test
      fun dnsFail() {
        client =
          OkHttpClient.Builder()
            .dns { _ -> throw UnknownHostException("reason") }
            .eventListenerFactory(loggingEventListenerFactory)
            .build()
        try {
          client.newCall(request().build()).execute()
          fail<Any>()
        } catch (expected: UnknownHostException) {
        }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 10.2K bytes
    - Viewed (0)
Back to top