Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for HttpURLConnection (0.86 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/WholeOperationTimeoutTest.kt

        server.enqueue(
          MockResponse
            .Builder()
            .code(HttpURLConnection.HTTP_MOVED_TEMP)
            .setHeader("Location", "/b")
            .headersDelay(100, TimeUnit.MILLISECONDS)
            .build(),
        )
        server.enqueue(
          MockResponse
            .Builder()
            .code(HttpURLConnection.HTTP_MOVED_TEMP)
            .setHeader("Location", "/c")
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  2. mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt

      private fun buildRequestThread(
        path: String,
        responseCode: AtomicInteger,
      ): Thread =
        Thread {
          val url = mockWebServer.url(path).toUrl()
          val conn: HttpURLConnection
          try {
            conn = url.openConnection() as HttpURLConnection
            responseCode.set(conn.responseCode) // Force the connection to hit the "server".
          } catch (ignored: IOException) {
          }
        }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  3. mockwebserver/src/main/kotlin/mockwebserver3/QueueDispatcher.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package mockwebserver3
    
    import java.net.HttpURLConnection
    import java.net.HttpURLConnection.HTTP_UNAVAILABLE
    import java.util.concurrent.BlockingQueue
    import java.util.concurrent.LinkedBlockingQueue
    import java.util.logging.Logger
    
    /**
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 14 16:09:26 UTC 2025
    - 2.9K bytes
    - Viewed (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/Response.kt

    package okhttp3
    
    import java.io.Closeable
    import java.io.IOException
    import java.net.HttpURLConnection.HTTP_MOVED_PERM
    import java.net.HttpURLConnection.HTTP_MOVED_TEMP
    import java.net.HttpURLConnection.HTTP_MULT_CHOICE
    import java.net.HttpURLConnection.HTTP_PROXY_AUTH
    import java.net.HttpURLConnection.HTTP_SEE_OTHER
    import java.net.HttpURLConnection.HTTP_UNAUTHORIZED
    import okhttp3.ResponseBody.Companion.asResponseBody
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 14:39:28 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  5. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        val url = server.url("/").toUrl()
        val connection = url.openConnection() as HttpURLConnection
        assertThat(connection.getResponseCode()).isEqualTo(HttpURLConnection.HTTP_OK)
        val refusedConnection = url.openConnection() as HttpURLConnection
        assertFailsWith<ConnectException> {
          refusedConnection.getResponseCode()
        }.also { expected ->
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 03 13:16:34 UTC 2025
    - 22.3K bytes
    - Viewed (0)
  6. src/main/java/org/codelibs/curl/CurlRequest.java

        /**
         * Opens a connection to the specified URL.
         *
         * @param u the URL
         * @return the HttpURLConnection
         * @throws IOException if an I/O exception occurs
         */
        protected HttpURLConnection open(final URL u) throws IOException {
            final HttpURLConnection connection = (HttpURLConnection) (proxy != null ? u.openConnection(proxy) : u.openConnection());
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Sat Jul 05 01:38:18 UTC 2025
    - 17.8K bytes
    - Viewed (0)
  7. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

            .shutdownServer(true)
            .build(),
        )
        val url = server.url("/").toUrl()
        val connection = url.openConnection() as HttpURLConnection
        assertThat(connection.responseCode).isEqualTo(HttpURLConnection.HTTP_OK)
        val refusedConnection = url.openConnection() as HttpURLConnection
        assertFailsWith<ConnectException> {
          refusedConnection.responseCode
        }.also { expected ->
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Aug 03 22:38:00 UTC 2025
    - 28K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

        testResponseRedirectedWithPost(HttpURLConnection.HTTP_MULT_CHOICE, TransferKind.END_OF_STREAM)
      }
    
      @Test
      fun response301MovedPermanentlyWithPost() {
        testResponseRedirectedWithPost(HttpURLConnection.HTTP_MOVED_PERM, TransferKind.END_OF_STREAM)
      }
    
      @Test
      fun response302MovedTemporarilyWithPost() {
        testResponseRedirectedWithPost(HttpURLConnection.HTTP_MOVED_TEMP, TransferKind.END_OF_STREAM)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 133.2K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/CacheTest.kt

        when (responseCode) {
          HttpURLConnection.HTTP_PROXY_AUTH -> {
            builder.addHeader("Proxy-Authenticate: Basic realm=\"protected area\"")
          }
    
          HttpURLConnection.HTTP_UNAUTHORIZED -> {
            builder.addHeader("WWW-Authenticate: Basic realm=\"protected area\"")
          }
    
          HttpURLConnection.HTTP_NO_CONTENT, HttpURLConnection.HTTP_RESET -> {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 16 09:39:51 UTC 2025
    - 113.6K bytes
    - Viewed (0)
  10. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/ConnectPlan.kt

              .readResponseHeaders(false)!!
              .request(nextRequest)
              .build()
          tunnelCodec.skipConnectBody(response)
    
          when (response.code) {
            HttpURLConnection.HTTP_OK -> return null
    
            HttpURLConnection.HTTP_PROXY_AUTH -> {
              nextRequest = route.address.proxyAuthenticator.authenticate(route, response)
                ?: throw IOException("Failed to authenticate with proxy")
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 18.6K bytes
    - Viewed (0)
Back to top