Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 257 for url (0.14 sec)

  1. mockwebserver/README.md

      server.enqueue(new MockResponse().setBody("sup, bra?"));
      server.enqueue(new MockResponse().setBody("yo dog"));
    
      // Start the server.
      server.start();
    
      // Ask the server for its URL. You'll need this to make HTTP requests.
      HttpUrl baseUrl = server.url("/v1/chat/");
    
      // Exercise your application code, which should make those HTTP requests.
      // Responses are returned in the same order that they are enqueued.
      Chat chat = new Chat(baseUrl);
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  2. okhttp/src/test/java/okhttp3/internal/http/ExternalHttp2Example.kt

        val client =
          OkHttpClient.Builder()
            .protocols(listOf(Protocol.HTTP_2, Protocol.HTTP_1_1))
            .build()
        val call =
          client.newCall(
            Request.Builder()
              .url("https://www.google.ca/")
              .build(),
          )
        val response = call.execute()
        try {
          println(response.code)
          println("PROTOCOL ${response.protocol}")
          var line: String?
    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)
  3. okhttp/src/test/java/okhttp3/internal/RecordingAuthenticator.kt

      val calls = mutableListOf<String>()
    
      override fun getPasswordAuthentication(): PasswordAuthentication? {
        calls.add(
          "host=$requestingHost port=$requestingPort site=${requestingSite.hostName} " +
            "url=$requestingURL type=$requestorType prompt=$requestingPrompt " +
            "protocol=$requestingProtocol scheme=$requestingScheme",
        )
        return authentication
      }
    
      companion object {
    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)
  4. samples/tlssurvey/src/main/kotlin/okhttp3/survey/ssllabs/SslLabsScrape.kt

    ) {
      private val moshi = Moshi.Builder().build()
    
      private val moshiConverterFactory = MoshiConverterFactory.create(moshi)
    
      private val retrofit =
        Retrofit.Builder()
          .baseUrl(SslLabsService.BASE_URL)
          .addConverterFactory(moshiConverterFactory)
          .callFactory(callFactory)
          .build()
    
      private val api = retrofit.create(SslLabsService::class.java)
    
      suspend fun query(): List<Client> {
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/PostFile.java

      private final OkHttpClient client = new OkHttpClient();
    
      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()) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/kt/Authenticate.kt

                  .header("Authorization", credential)
                  .build()
              }
            },
          )
          .build()
    
      fun run() {
        val request =
          Request.Builder()
            .url("http://publicobject.com/secrets/hellosecret.txt")
            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

              int x = n / i;
              if (x * i == n) return factor(x) + " × " + i;
            }
            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()) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  8. samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt

      }
    
      @Test fun get(server: MockWebServer) {
        server.enqueue(
          MockResponse.Builder()
            .body("hello, Apache HttpClient 5.x")
            .build(),
        )
    
        val request = HttpGet(server.url("/").toUri())
        request.addHeader("Accept", "text/plain")
    
        httpClient.execute(request).use { response ->
          assertThat(response.code).isEqualTo(200)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  9. samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt

            .build()
    
        server.enqueue(
          MockResponse.Builder()
            .body("hello, Java HTTP Client")
            .build(),
        )
    
        val request =
          HttpRequest.newBuilder(server.url("/").toUri())
            .header("Accept", "text/plain")
            .build()
    
        val response = httpClient.send(request, BodyHandlers.ofString())
        assertThat(response.statusCode()).isEqualTo(200)
    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)
  10. okhttp/src/main/kotlin/okhttp3/Authenticator.kt

     * does not participate in any [interceptors][Interceptor] or [event listeners][EventListener]. It
     * doesn't include the motivating request's HTTP headers or even its full URL; only the target
     * server's hostname is sent to the proxy.
     *
     * Prior to sending any CONNECT request OkHttp always calls the proxy authenticator so that it may
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.5K bytes
    - Viewed (0)
Back to top