Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 230 for Code (0.15 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/http/HttpHeaders.kt

    private fun Buffer.skipCommasAndWhitespace(): Boolean {
      var commaFound = false
      loop@ while (!exhausted()) {
        when (this[0]) {
          ','.code.toByte() -> {
            // Consume ','.
            readByte()
            commaFound = true
          }
    
          ' '.code.toByte(), '\t'.code.toByte() -> {
            readByte()
            // Consume space or tab.
          }
    
          else -> break@loop
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http/StatusLine.kt

    class StatusLine(
      @JvmField val protocol: Protocol,
      @JvmField val code: Int,
      @JvmField val message: String,
    ) {
      override fun toString(): String {
        return buildString {
          if (protocol == Protocol.HTTP_1_0) {
            append("HTTP/1.0")
          } else {
            append("HTTP/1.1")
          }
          append(' ').append(code)
          append(' ').append(message)
        }
      }
    
      companion object {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  3. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        client.newCall(request).execute().use { response ->
          assertEquals(200, response.code)
        }
    
        client.connectionPool.evictAll()
        assertEquals(0, client.connectionPool.connectionCount())
    
        client.newCall(request).execute().use { response ->
          assertEquals(200, response.code)
        }
    
        assertEquals(2, sessionIds.size)
        assertEquals(sessionIds[0], sessionIds[1])
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 27K bytes
    - Viewed (1)
  4. okhttp/src/main/kotlin/okhttp3/Cache.kt

            sink.writeUtf8(url.toString()).writeByte('\n'.code)
            sink.writeUtf8(requestMethod).writeByte('\n'.code)
            sink.writeDecimalLong(varyHeaders.size.toLong()).writeByte('\n'.code)
            for (i in 0 until varyHeaders.size) {
              sink.writeUtf8(varyHeaders.name(i))
                .writeUtf8(": ")
                .writeUtf8(varyHeaders.value(i))
                .writeByte('\n'.code)
            }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  5. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        assertThat(inputStream.read()).isEqualTo('A'.code)
        assertThat(inputStream.read()).isEqualTo('B'.code)
        assertThat(inputStream.read()).isEqualTo('C'.code)
        assertThat(inputStream.read()).isEqualTo('D'.code)
        assertThat(inputStream.read()).isEqualTo('E'.code)
        assertThat(inputStream.read()).isEqualTo('F'.code)
        assertThat(inputStream.read()).isEqualTo(-1)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 21.9K bytes
    - Viewed (0)
  6. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

          this.pushPromises = mockResponse.pushPromises.toMutableList()
          this.settings =
            Settings().apply {
              merge(mockResponse.settings)
            }
        }
    
        fun code(code: Int) =
          apply {
            this.code = code
          }
    
        /** Sets the status and returns this. */
        fun status(status: String) =
          apply {
            this.status = status
          }
    
        /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 13.3K bytes
    - Viewed (1)
  7. okhttp/src/test/java/okhttp3/CallTest.kt

              call: Call,
              response: Response,
            ) {
              val bytes = response.body.byteStream()
              assertThat(bytes.read()).isEqualTo('a'.code)
              assertThat(bytes.read()).isEqualTo('b'.code)
              assertThat(bytes.read()).isEqualTo('c'.code)
    
              // This request will share a connection with 'A' cause it's all done.
    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)
  8. samples/guide/src/main/java/okhttp3/recipes/kt/CacheResponse.kt

            .url("http://publicobject.com/helloworld.txt")
            .build()
    
        val response1Body =
          client.newCall(request).execute().use {
            if (!it.isSuccessful) throw IOException("Unexpected code $it")
    
            println("Response 1 response:          $it")
            println("Response 1 cache response:    ${it.cacheResponse}")
            println("Response 1 network response:  ${it.networkResponse}")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2K bytes
    - Viewed (2)
  9. okhttp-android/src/test/kotlin/okhttp3/android/RobolectricOkHttpClientTest.kt

        val call = client.newCall(networkRequest)
    
        call.execute().use { response ->
          assertThat(response.code).isEqualTo(200)
          assertThat(response.cacheResponse).isNull()
        }
    
        val cachedCall = client.newCall(request)
    
        cachedCall.execute().use { response ->
          assertThat(response.code).isEqualTo(200)
          assertThat(response.cacheResponse).isNotNull()
        }
      }
    
      private fun assumeNetwork() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  10. mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionLifecycleTest.kt

        clientTestRule.newClient().newCall(Request(server.url("/"))).execute().use {
          assertThat(it.code).isEqualTo(200)
        }
      }
    
      @Test
      fun testClient2(server: MockWebServer) {
        assertThat(server).isSameInstanceAs(instanceServer)
    
        clientTestRule.newClient().newCall(Request(server.url("/"))).execute().use {
          assertThat(it.code).isEqualTo(200)
        }
      }
    
      @ParameterizedTest
      @ValueSource(ints = [1, 2])
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 11 12:12:36 GMT 2024
    - 3K bytes
    - Viewed (0)
Back to top