Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 175 for execute (0.44 sec)

  1. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java

            .build();
    
        Request request = new Request.Builder()
            .url("http://publicobject.com/helloworld.txt")
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          System.out.println(response.body().string());
        }
    
        server.shutdown();
        socketFile.delete();
      }
    
      public static void main(String... args) throws Exception {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Dec 24 03:46:30 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ConnectionListenerTest.kt

        server!!.enqueue(MockResponse())
        server!!.enqueue(MockResponse())
    
        client.newCall(Request(server!!.url("/")))
          .execute().close()
    
        client.newCall(Request(server!!.url("/")))
          .execute().close()
    
        assertThat(listener.recordedEventTypes()).containsExactly(
          "ConnectStart",
          "ConnectEnd",
          "ConnectionAcquired",
          "ConnectionReleased",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  3. okcurl/src/main/kotlin/okhttp3/curl/internal/-MainCommon.kt

      return s.equals("Content-Type", ignoreCase = true)
    }
    
    fun Main.commonRun() {
      client = createClient()
      val request = createRequest()
    
      try {
        val response = client!!.newCall(request).execute()
        if (showHeaders) {
          println(StatusLine.get(response))
          val headers = response.headers
          for ((name, value) in headers) {
            println("$name: $value")
          }
          println()
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/DuplexTest.kt

        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/"))
              .post(AsyncRequestBody())
              .build(),
          )
        assertFailsWith<ProtocolException> {
          call.execute()
        }
      }
    
      @Test
      fun trueDuplexClientWritesFirst() {
        enableProtocol(Protocol.HTTP_2)
        val body =
          MockStreamHandler()
            .receiveRequest("request A\n")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt

            .build()
        val request = Request(server.url("/"))
        val response1: Response = client.newCall(request).execute()
        val bodySource = response1.body.source()
        assertThat(bodySource.readUtf8()).isEqualTo("ABC.1")
    
        corruptor()
    
        return client.newCall(request).execute()
      }
    
      /**
       * @param delta the offset from the current date to use. Negative values yield dates in the past;
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (1)
  6. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt

              return block()
            }
          },
          delayNanos,
        )
      }
    
      /**
       * Executes [block] once on a task runner thread.
       *
       * TODO: make this inline once this is fixed: https://github.com/oracle/graal/issues/3466
       */
      fun execute(
        name: String,
        delayNanos: Long = 0L,
        cancelable: Boolean = true,
        block: () -> Unit,
      ) {
        schedule(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/TestTls13Request.kt

      url: String,
    ) {
      System.out.printf("%-40s ", url)
      System.out.flush()
      println(Platform.get())
      val request =
        Request.Builder()
          .url(url)
          .build()
      try {
        client.newCall(request).execute().use { response ->
          val handshake = response.handshake
          println(
            "${handshake!!.tlsVersion} ${handshake.cipherSuite} ${response.protocol} " +
              "${response.code} ${response.body.bytes().size}b",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/kt/YubikeyClientAuth.kt

        // An example test URL that returns client certificate details.
        val request =
          Request.Builder()
            .url("https://prod.idrix.eu/secure/")
            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          println(response.body.string())
        }
      }
    }
    
    object ConsoleCallbackHandler : CallbackHandler {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (1)
  9. okhttp/src/test/java/okhttp3/CacheTest.kt

        server.enqueue(mockResponse.build())
    
        client.newCall(request).execute().use {
          it.body.bytes()
        }
        return client.newCall(request).execute()
      }
    
      private operator fun get(url: HttpUrl): Response {
        val request =
          Request.Builder()
            .url(url)
            .build()
        return client.newCall(request).execute()
      }
    
      private fun writeFile(
        directory: Path,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/kt/CertificatePinning.kt

              .build(),
          )
          .build()
    
      fun run() {
        val request =
          Request.Builder()
            .url("https://publicobject.com/robots.txt")
            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          for (certificate in response.handshake!!.peerCertificates) {
            println(CertificatePinner.pin(certificate))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
Back to top