Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 41 for toHttpUrl (0.12 sec)

  1. container-tests/src/test/java/okhttp3/containers/BasicMockServerTest.kt

     */
    package okhttp3.containers
    
    import assertk.assertThat
    import assertk.assertions.contains
    import javax.net.ssl.TrustManagerFactory
    import javax.net.ssl.X509TrustManager
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import org.junit.jupiter.api.Test
    import org.mockserver.client.MockServerClient
    import org.mockserver.configuration.Configuration
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/RequestCommonTest.kt

    import kotlin.test.Test
    import kotlin.test.assertFailsWith
    import okhttp3.Headers.Companion.headersOf
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.RequestBody.Companion.toRequestBody
    
    class RequestCommonTest {
      @Test
      fun constructorNormal() {
        val url = "https://example.com/".toHttpUrl()
        val body = "hello".toRequestBody()
        val headers = headersOf("User-Agent", "RequestTest")
        val method = "PUT"
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  3. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

    import assertk.assertions.contains
    import assertk.assertions.isEqualTo
    import java.net.HttpURLConnection
    import java.net.Proxy
    import java.net.URI
    import javax.net.ssl.HttpsURLConnection
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Protocol
    import okhttp3.Request
    import okhttp3.containers.BasicMockServerTest.Companion.MOCKSERVER_IMAGE
    import okhttp3.containers.BasicMockServerTest.Companion.trustMockServer
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  4. container-tests/src/test/java/okhttp3/containers/SocksProxyTest.kt

    package okhttp3.containers
    
    import assertk.assertThat
    import assertk.assertions.contains
    import java.net.InetSocketAddress
    import java.net.Proxy
    import java.net.Proxy.Type.SOCKS
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.containers.BasicMockServerTest.Companion.MOCKSERVER_IMAGE
    import org.junit.jupiter.api.Test
    import org.mockserver.client.MockServerClient
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/UrlComponentEncodingTester.kt

        val url = urlString.toHttpUrl()
        val actual = component.encodedValue(url)
        if (actual != expected) {
          fail("Encoding $component $codePoint using $encoding: '$actual' != '$expected'")
        }
      }
    
      private fun testForbidden(
        codePoint: Int,
        codePointString: String,
        component: Component,
      ) {
        val builder = "http://host/".toHttpUrl().newBuilder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  6. android-test-app/src/main/kotlin/okhttp/android/testapp/MainActivity.kt

    import okhttp3.Callback
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.Response
    import okio.IOException
    
    class MainActivity : ComponentActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    
        val client = OkHttpClient()
    
        val url = "https://github.com/square/okhttp".toHttpUrl()
        println(url.topPrivateDomain())
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/UrlComponentEncodingTesterJvm.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3
    
    import assertk.fail
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
    import okhttp3.UrlComponentEncodingTester.Component
    
    fun urlComponentEncodingTesterJvmPlatform(component: Component): UrlComponentEncodingTester.Platform {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  8. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/TestDohMain.kt

     * limitations under the License.
     */
    package okhttp3.dnsoverhttps
    
    import java.io.File
    import java.net.UnknownHostException
    import java.security.Security
    import okhttp3.Cache
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.dnsoverhttps.DohProviders.providers
    import org.conscrypt.OpenSSLProvider
    
    private fun runBatch(
      dnsProviders: List<DnsOverHttps>,
      names: List<String>,
    ) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  9. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

        assumeNetwork()
    
        val call = client.newCall(Request("https://google.com/robots.txt".toHttpUrl()))
    
        call.execute().use { response ->
          assertThat(response.code).isEqualTo(200)
        }
      }
    
      @Test
      fun testRequestInvalid() {
        val call = client.newCall(Request("https://google.invalid/".toHttpUrl()))
    
        try {
          call.execute()
          fail("Request can't succeed")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/kt/PostStreaming.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.io.IOException
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.RequestBody
    import okio.BufferedSink
    
    class PostStreaming {
      private val client = OkHttpClient()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.9K bytes
    - Viewed (0)
Back to top