Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 181 for httpclient (0.04 sec)

  1. regression-test/src/androidTest/java/okhttp/regression/IssueReproductionTest.java

     */
    @RunWith(AndroidJUnit4.class)
    public class IssueReproductionTest {
      @Test public void getFailsWithoutAdditionalCert() throws IOException {
        OkHttpClient client = new OkHttpClient();
    
        sendRequest(client, "https://google.com/robots.txt");
      }
    
      private void sendRequest(OkHttpClient client, String url) throws IOException {
        Request request = new Request.Builder()
                .url(url)
                .build();
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 26 06:37:08 UTC 2021
    - 1.9K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/PerCallSettings.java

     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import java.util.concurrent.TimeUnit;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class PerCallSettings {
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun May 22 01:29:42 UTC 2016
    - 1.9K bytes
    - Viewed (0)
  3. okhttp-brotli/src/test/java/okhttp3/brotli/BrotliTestMain.kt

     */
    package okhttp3.brotli
    
    import okhttp3.OkHttpClient
    import okhttp3.Request
    
    fun main() {
      val client =
        OkHttpClient
          .Builder()
          .addInterceptor(BrotliInterceptor)
          .build()
    
      sendRequest("https://httpbin.org/brotli", client)
      sendRequest("https://httpbin.org/gzip", client)
    }
    
    private fun sendRequest(
      url: String,
      client: OkHttpClient,
    ) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.1K bytes
    - Viewed (1)
  4. okhttp-urlconnection/src/main/kotlin/okhttp3/JavaNetAuthenticator.kt

    package okhttp3
    
    import java.io.IOException
    import okhttp3.Authenticator.Companion.JAVA_NET_AUTHENTICATOR
    
    /**
     * Do not use this.
     *
     * Instead, configure your OkHttpClient.Builder to use `Authenticator.JAVA_NET_AUTHENTICATOR`:
     *
     * ```
     *   val okHttpClient = OkHttpClient.Builder()
     *     .authenticator(okhttp3.Authenticator.Companion.JAVA_NET_AUTHENTICATOR)
     *     .build()
     * ```
     */
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/guide/GetExample.java

     * limitations under the License.
     */
    package okhttp3.guide;
    
    import java.io.IOException;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public class GetExample {
      final OkHttpClient client = new OkHttpClient();
    
      String run(String url) throws IOException {
        Request request = new Request.Builder()
            .url(url)
            .build();
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

    package okhttp3.recipes;
    
    import java.util.concurrent.TimeUnit;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.WebSocket;
    import okhttp3.WebSocketListener;
    import okio.ByteString;
    
    public final class WebSocketEcho extends WebSocketListener {
      private void run() {
        OkHttpClient client = new OkHttpClient.Builder()
            .readTimeout(0,  TimeUnit.MILLISECONDS)
            .build();
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Apr 04 11:40:21 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  7. okhttp-zstd/src/test/java/okhttp3/zstd/ZstdTestMain.kt

     * limitations under the License.
     */
    package okhttp3.zstd
    
    import okhttp3.CompressionInterceptor
    import okhttp3.OkHttpClient
    import okhttp3.Request
    
    fun main() {
      val client =
        OkHttpClient
          .Builder()
          .addInterceptor(CompressionInterceptor(Zstd))
          .build()
    
      sendRequest("https://developers.facebook.com/docs/", client)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 20:01:04 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  8. regression-test/src/androidTest/java/okhttp/regression/compare/OkHttpClientTest.java

     * https://square.github.io/okhttp/
     */
    @RunWith(AndroidJUnit4.class)
    public class OkHttpClientTest {
      @Test public void get() throws IOException {
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
            .url("https://google.com/robots.txt")
            .build();
        try (Response response = client.newCall(request).execute()) {
          assertEquals(200, response.code());
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Nov 14 17:38:22 UTC 2020
    - 1.4K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PostFile.java

    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public final class PostFile {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat May 25 18:02:55 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  10. android-test/src/androidTest/java/okhttp/android/test/StrictModeTest.kt

        applyStrictMode()
    
        // Not currently safe
        // See https://github.com/square/okhttp/pull/8248
        OkHttpClient()
    
        assertThat(violations).hasSize(1)
        assertThat(violations[0].message).isEqualTo("newSSLContext")
      }
    
      @Test
      fun testNewCall() {
        Platform.resetForTests()
    
        val client = OkHttpClient()
    
        applyStrictMode()
    
        // Safe on main
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu May 22 14:39:30 UTC 2025
    - 2.1K bytes
    - Viewed (0)
Back to top