Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for setResponseCode (0.18 sec)

  1. mockwebserver/README.md

                case "/v1/login/auth/":
                    return new MockResponse().setResponseCode(200);
                case "/v1/check/version/":
                    return new MockResponse().setResponseCode(200).setBody("version=9");
                case "/v1/profile/info":
                    return new MockResponse().setResponseCode(200).setBody("{\\\"info\\\":{\\\"name\":\"Lucas Albuquerque\",\"age\":\"21\",\"gender\":\"male\"}}");
            }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Dec 17 15:34:10 UTC 2023
    - 5K bytes
    - Viewed (0)
  2. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

      var settings: Settings = Settings()
        private set
      var webSocketListener: WebSocketListener? = null
        private set
    
      val pushPromises: List<PushPromise>
        get() = promises
    
      init {
        setResponseCode(200)
        setHeader("Content-Length", 0L)
      }
    
      public override fun clone(): MockResponse {
        val result = super.clone() as MockResponse
        result.headersBuilder = headersBuilder.build().newBuilder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/kt/DevServer.kt

      val handshakeCertificates = TlsUtil.localhost()
    
      val server =
        MockWebServer().apply {
          useHttps(handshakeCertificates.sslSocketFactory(), false)
    
          enqueue(
            MockResponse()
              .setResponseCode(HTTP_MOVED_TEMP)
              .setHeader("Location", "https://www.google.com/robots.txt"),
          )
        }
    
      val clientCertificates =
        HandshakeCertificates.Builder()
          .addPlatformTrustedCertificates()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  4. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

      fun mockResponse() {
        var mockResponse: MockResponse = MockResponse()
        var status: String = mockResponse.status
        status = mockResponse.status
        mockResponse.status = ""
        mockResponse = mockResponse.setResponseCode(0)
        var headers: Headers = mockResponse.headers
        var trailers: Headers = mockResponse.trailers
        mockResponse = mockResponse.clearHeaders()
        mockResponse = mockResponse.addHeader("")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  5. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

            "Informational",
            "OK",
            "Redirection",
            "Client Error",
            "Server Error",
            "Mock Response",
          )
        for (i in 0..599) {
          val response = MockResponse().setResponseCode(i)
          val expectedReason = reasons[i / 100]
          assertThat(response.status).isEqualTo("HTTP/1.1 $i $expectedReason")
          assertThat(headersToList(response)).containsExactly("Content-Length: 0")
        }
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

      fun mockResponse() {
        var mockResponse: MockResponse = MockResponse()
        var status: String = mockResponse.status
        status = mockResponse.status
        mockResponse.status = ""
        mockResponse = mockResponse.setResponseCode(0)
        var headers: Headers = mockResponse.headers
        var trailers: Headers = mockResponse.trailers
        mockResponse = mockResponse.clearHeaders()
        mockResponse = mockResponse.addHeader("")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
Back to top