Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 188 for Code (0.13 sec)

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

      try {
        client.newCall(request).execute().use { response ->
          val handshake = response.handshake
          println(
            "${handshake!!.tlsVersion} ${handshake.cipherSuite} ${response.protocol} " +
              "${response.code} ${response.body.bytes().size}b",
          )
        }
      } catch (ioe: IOException) {
        println(ioe)
      }
    }
    
    fun main(vararg args: String) {
      // System.setProperty("javax.net.debug", "ssl:handshake:verbose");
    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)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/YubikeyClientAuth.kt

          Request.Builder()
            .url("https://prod.idrix.eu/secure/")
            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          println(response.body.string())
        }
      }
    }
    
    object ConsoleCallbackHandler : CallbackHandler {
      override fun handle(callbacks: Array<Callback>) {
        for (callback in callbacks) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (1)
  3. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

        call.execute().use { response ->
          assertThat(response.code).isEqualTo(200)
        }
      }
    
      @Test
      fun testRequestExternal() {
        assumeNetwork()
    
        val call = client.newCall(Request("https://google.com/robots.txt".toHttpUrl()))
    
        call.execute().use { response ->
          assertThat(response.code).isEqualTo(200)
        }
      }
    
      @Test
      fun testRequestInvalid() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/MultipartReaderTest.kt

          assertThat(expected).hasMessage("expected at least 1 part")
        }
      }
    
      @Test fun `skip preamble`() {
        val multipart =
          """
          |this is the preamble! it is invisible to application code
          |
          |--simple boundary
          |
          |abcd
          |--simple boundary--
          """.trimMargin()
            .replace("\n", "\r\n")
    
        val parts =
          MultipartReader(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.8K bytes
    - Viewed (0)
  5. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

        bodyGetNoBody(204)
      }
    
      @Test
      fun bodyGet205() {
        setLevel(Level.BODY)
        bodyGetNoBody(205)
      }
    
      private fun bodyGetNoBody(code: Int) {
        server.enqueue(
          MockResponse.Builder()
            .status("HTTP/1.1 $code No Content")
            .build(),
        )
        val response = client.newCall(request().build()).execute()
        response.body.close()
        applicationLogs
    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)
  6. okhttp/src/main/kotlin/okhttp3/Call.kt

       *
       * Note that transport-layer success (receiving a HTTP response code, headers and body) does not
       * necessarily indicate application-layer success: `response` may still indicate an unhappy HTTP
       * response code like 404 or 500.
       *
       * @throws IOException if the request could not be executed due to cancellation, a connectivity
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        val response = call.execute()
        val inputStream = response.body.byteStream()
        assertThat(inputStream.read()).isEqualTo('A'.code)
        assertThat(inputStream.read()).isEqualTo('B'.code)
        assertThat(inputStream.read()).isEqualTo('C'.code)
        assertThat(inputStream.read()).isEqualTo(-1)
        assertThat(inputStream.read()).isEqualTo(-1)
        inputStream.close()
      }
    
      @ParameterizedTest
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

      }
    
      @Test @Disabled
      fun response() {
        val response: Response = Response.Builder().build()
        val request: Request = response.request()
        val protocol: Protocol = response.protocol()
        val code: Int = response.code()
        val message: String = response.message()
        val handshake: Handshake? = response.handshake()
        val headers: Headers = response.headers()
        val body: ResponseBody = response.body()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.3K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/kt/CertificatePinning.kt

          Request.Builder()
            .url("https://publicobject.com/robots.txt")
            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          for (certificate in response.handshake!!.peerCertificates) {
            println(CertificatePinner.pin(certificate))
          }
        }
      }
    }
    
    fun main() {
      CertificatePinning().run()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/http/StatusLineTest.kt

        val message = "Temporary Redirect"
        val version = 1
        val code = 200
        val statusLine = parse("HTTP/1.$version $code $message")
        assertThat(statusLine.message).isEqualTo(message)
        assertThat(statusLine.protocol).isEqualTo(Protocol.HTTP_1_1)
        assertThat(statusLine.code).isEqualTo(code)
      }
    
      @Test
      fun emptyMessage() {
        val version = 1
        val code = 503
        val statusLine = parse("HTTP/1.$version $code ")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
Back to top