Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 155 for okHttpClient (0.12 sec)

  1. 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 Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  2. 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 Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 04 11:40:21 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  3. 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 Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Nov 14 17:38:22 UTC 2020
    - 1.4K bytes
    - Viewed (0)
  4. 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 Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun May 22 01:29:42 UTC 2016
    - 1.9K bytes
    - Viewed (0)
  5. 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 Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat May 25 18:02:55 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  6. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

    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
    import okio.buffer
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/LoggingInterceptors.java

    import java.io.IOException;
    import java.util.logging.Logger;
    import okhttp3.Interceptor;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class LoggingInterceptors {
      private static final Logger logger = Logger.getLogger(LoggingInterceptors.class.getName());
      private final OkHttpClient client = new OkHttpClient.Builder()
          .addInterceptor(new LoggingInterceptor())
          .build();
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Jan 01 15:55:32 UTC 2016
    - 2K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java

     */
    package okhttp3.recipes;
    
    import java.util.concurrent.TimeUnit;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class ConfigureTimeouts {
      private final OkHttpClient client;
    
      public ConfigureTimeouts() throws Exception {
        client = new OkHttpClient.Builder()
            .connectTimeout(5, TimeUnit.SECONDS)
            .writeTimeout(5, TimeUnit.SECONDS)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Sep 28 18:00:26 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/SynchronousGet.java

     * limitations under the License.
     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import okhttp3.Headers;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class SynchronousGet {
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun May 22 01:29:42 UTC 2016
    - 1.5K bytes
    - Viewed (0)
  10. samples/tlssurvey/src/main/kotlin/okhttp3/survey/Iana.kt

        } ?: throw IllegalArgumentException("No such suite: $javaName")
      }
    }
    
    suspend fun fetchIanaSuites(okHttpClient: OkHttpClient): IanaSuites {
      val url = "https://www.iana.org/assignments/tls-parameters/tls-parameters-4.csv"
    
      val call = okHttpClient.newCall(Request(url.toHttpUrl()))
    
      val suites =
        call.executeAsync().use {
          if (!it.isSuccessful) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 18 01:24:38 UTC 2024
    - 2K bytes
    - Viewed (0)
Back to top