Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for toUrl (0.16 sec)

  1. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        )
        server.enqueue(MockResponse()) // The jdk's HttpUrlConnection is a bastard.
        server.enqueue(MockResponse())
        try {
          server.url("/a").toUrl().openConnection().getInputStream()
          fail<Any>()
        } catch (expected: IOException) {
        }
        server.url("/b").toUrl().openConnection().getInputStream() // Should succeed.
      }
    
      /**
    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)
  2. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

          assertThat(response.protocol).isEqualTo(Protocol.HTTP_1_1)
        }
      }
    
      @Test
      fun testUrlConnectionDirect() {
        testRequest {
          val url = URI(mockServer.endpoint + "/person?name=peter").toURL()
    
          val connection = url.openConnection() as HttpURLConnection
    
          assertThat(connection.inputStream.source().buffer().readUtf8()).contains("Peter the person")
        }
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

          ),
        )
        assertContent("This is the 2nd server!", getResponse(newRequest("/a")))
        assertThat(proxySelectionRequests).isEqualTo(
          listOf(
            server.url("/").toUrl().toURI(),
            server2.url("/").toUrl().toURI(),
          ),
        )
      }
    
      @Test
      fun redirectWithAuthentication() {
        server2.enqueue(
          MockResponse(body = "Page 2"),
        )
        server.enqueue(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  4. build.gradle.kts

            includes.from(project.file("Module.md"))
          }
          externalDocumentationLink {
            url.set(URI.create("https://square.github.io/okio/3.x/okio/").toURL())
            packageListUrl.set(URI.create("https://square.github.io/okio/3.x/okio/okio/package-list").toURL())
          }
        }
      }
    
      plugins.withId("com.vanniktech.maven.publish.base") {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:32:42 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  5. mockwebserver-junit4/src/test/java/mockwebserver3/junit4/MockWebServerRuleTest.kt

              override fun evaluate() {
                called.set(true)
                rule.server.url("/").toUrl().openConnection().connect()
              }
            },
            Description.EMPTY,
          )
        statement.evaluate()
        assertThat(called.get()).isTrue()
        try {
          rule.server.url("/").toUrl().openConnection().connect()
          fail()
        } catch (expected: ConnectException) {
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (1)
  6. okhttp/src/main/kotlin/okhttp3/internal/authenticator/JavaNetAuthenticator.kt

                challenge.scheme,
                url.toUrl(),
                Authenticator.RequestorType.PROXY,
              )
            } else {
              Authenticator.requestPasswordAuthentication(
                url.host,
                proxy.connectToInetAddress(url, dns),
                url.port,
                url.scheme,
                challenge.realm,
                challenge.scheme,
                url.toUrl(),
                Authenticator.RequestorType.SERVER,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  7. mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt

              requestsMade.add(request)
              return MockResponse()
            }
          }
        assertThat(requestsMade.size).isEqualTo(0)
        mockWebServer.dispatcher = dispatcher
        val url = mockWebServer.url("/").toUrl()
        val conn = url.openConnection() as HttpURLConnection
        conn.responseCode // Force the connection to hit the "server".
        // Make sure our dispatcher got the request.
        assertThat(requestsMade.size).isEqualTo(1)
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/HttpUrlJvmTest.kt

        assertThat(uri.toHttpUrlOrNull()).isNull()
      }
    
      @Test
      fun toJavaNetUrl() {
        val httpUrl = "http://username:password@host/path?query#fragment".toHttpUrl()
        val javaNetUrl = httpUrl.toUrl()
        assertThat(javaNetUrl.toString())
          .isEqualTo("http://username:password@host/path?query#fragment")
      }
    
      @Test
      fun toUri() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/UrlComponentEncodingTesterJvm.kt

        encoding: UrlComponentEncodingTester.Encoding,
        component: Component,
      ) {
        val encoded = encoding.encode(codePoint)
        val httpUrl = component.urlString(encoded).toHttpUrl()
        val javaNetUrl = httpUrl.toUrl()
        if (javaNetUrl.toString() != javaNetUrl.toString()) {
          fail("Encoding $component $codePoint using $encoding")
        }
      }
    
      private fun testFromUrl(
        codePoint: Int,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  10. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        server.enqueue(MockResponse())
        try {
          server.url("/a").toUrl().openConnection().getInputStream()
          fail<Unit>()
        } catch (expected: IOException) {
          // Expected.
        }
        server.url("/b").toUrl().openConnection().getInputStream() // Should succeed.
      }
    
      @Test
      fun clearDispatcherQueue() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 23.5K bytes
    - Viewed (0)
Back to top