- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for toUrl (0.14 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
okhttp/src/main/kotlin/okhttp3/HttpUrl.kt
PublicSuffixDatabase.get().getEffectiveTldPlusOne(host) } } @JvmName("-deprecated_url") @Deprecated( message = "moved to toUrl()", replaceWith = ReplaceWith(expression = "toUrl()"), level = DeprecationLevel.ERROR, ) fun url(): URL = toUrl() @JvmName("-deprecated_uri") @Deprecated( message = "moved to toUri()", replaceWith = ReplaceWith(expression = "toUri()"),
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Tue Jan 09 12:33:05 GMT 2024 - 63.5K bytes - Viewed (1) -
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)