Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 101 for Post (0.15 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/PostFile.java

      public void run() throws Exception {
        File file = new File("README.md");
    
        Request request = new Request.Builder()
            .url("https://api.github.com/markdown/raw")
            .post(RequestBody.create(file, MEDIA_TYPE_MARKDOWN))
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

            }
            return Integer.toString(n);
          }
        };
    
        Request request = new Request.Builder()
            .url("https://api.github.com/markdown/raw")
            .post(requestBody)
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  3. okcurl/src/main/kotlin/okhttp3/curl/Main.kt

    class Main : CliktCommand(name = NAME, help = "A curl for the next-generation web.") {
      val method: String? by option("-X", "--request", help = "Specify request command to use")
    
      val data: String? by option("-d", "--data", help = "HTTP POST data")
    
      val headers: List<String>? by option("-H", "--header", help = "Custom header to pass to server").multiple()
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (1)
  4. mockwebserver/README.md

    ```
    
    
    #### RecordedRequest
    
    Verify requests by their method, path, HTTP version, body, and headers.
    
    ```java
    RecordedRequest request = server.takeRequest();
    assertEquals("POST /v1/chat/send HTTP/1.1", request.getRequestLine());
    assertEquals("application/json; charset=utf-8", request.getHeader("Content-Type"));
    assertEquals("{}", request.getBody().readUtf8());
    ```
    
    #### Dispatcher
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  5. docs/features/events.md

        .build();
    client.newCall(newYorkTimesRequest).enqueue(new Callback() {
      ...
    });
    ```
    
    Running this race over home WiFi shows the Times (`0002`) completes just slightly sooner than the Post (`0001`):
    
    ```
    0001 https://www.washingtonpost.com/
    0001 0.000 callStart
    0002 https://www.nytimes.com/
    0002 0.000 callStart
    0002 0.010 dnsStart
    0001 0.013 dnsStart
    0001 0.022 dnsEnd
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 7.7K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/Dns.kt

     */
    package okhttp3
    
    import java.net.InetAddress
    import java.net.UnknownHostException
    import okhttp3.Dns.Companion.SYSTEM
    
    /**
     * A domain name service that resolves IP addresses for host names. Most applications will use the
     * [system DNS service][SYSTEM], which is the default. Some applications may provide their own
     * implementation to use a different DNS server, to prefer IPv6 addresses, to prefer IPv4 addresses,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  7. mockwebserver/src/test/java/mockwebserver3/MockResponseSniTest.kt

            Request(
              url = "https://url-host.com:${server.port}/".toHttpUrl(),
              headers = headersOf("Host", "header-host"),
            ),
          )
        val response = call.execute()
        assertThat(response.isSuccessful).isTrue()
    
        val recordedRequest = server.takeRequest()
        assertThat(recordedRequest.requestUrl!!.host).isEqualTo("header-host")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (1)
  8. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainSocketFactory.java

      }
    
      @Override public Socket createSocket(InetAddress host, int port) throws IOException {
        Socket result = createSocket();
    
        try {
          result.connect(new InetSocketAddress(host, port));
        } catch (IOException e) {
          result.close();
          throw e;
        }
        return result;
      }
    
      @Override public Socket createSocket(
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Dec 03 21:33:52 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  9. container-tests/src/test/java/okhttp3/containers/SocksProxyTest.kt

      @Container
      val socks5Proxy =
        GenericContainer(SOCKS5_PROXY)
          .withNetwork(network)
          .withExposedPorts(1080)
    
      @Test
      fun testLocal() {
        MockServerClient(mockServer.host, mockServer.serverPort).use { mockServerClient ->
          mockServerClient
            .`when`(
              request().withPath("/person")
                .withQueryStringParameter("name", "peter"),
            )
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  10. okhttp-urlconnection/build.gradle.kts

    import com.vanniktech.maven.publish.KotlinJvm
    
    plugins {
      kotlin("jvm")
      id("org.jetbrains.dokka")
      id("com.vanniktech.maven.publish.base")
      id("binary-compatibility-validator")
    }
    
    project.applyOsgi(
      "Fragment-Host: com.squareup.okhttp3; bundle-version=\"\${range;[==,+);\${version_cleanup;${projects.okhttp.version}}}\"",
      "Automatic-Module-Name: okhttp3.urlconnection",
      "Bundle-SymbolicName: com.squareup.okhttp3.urlconnection",
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Nov 20 16:20:29 GMT 2023
    - 764 bytes
    - Viewed (0)
Back to top