Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for REQUEST (0.03 sec)

  1. docs/recipes.md

        ```java
          private final OkHttpClient client = new OkHttpClient();
    
          public void run() throws Exception {
            Request request = new Request.Builder()
                .url("https://publicobject.com/helloworld.txt")
                .build();
    
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 47.8K bytes
    - Viewed (0)
  2. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSource.kt

     * limitations under the License.
     */
    package okhttp3.sse
    
    import okhttp3.Call
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.sse.internal.RealEventSource
    
    interface EventSource {
      /** Returns the original request that initiated this event source. */
      fun request(): Request
    
      /**
       * Immediately and violently release resources held by this event source. This does nothing if
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealCall.kt

      override fun clone(): Call = RealCall(client, originalRequest, forWebSocket)
    
      override fun request(): Request = originalRequest
    
      /**
       * Immediately closes the socket connection if it's currently held. Use this to interrupt an
       * in-flight request from any thread. It's the caller's responsibility to close the request body
       * and response body streams; otherwise resources may be leaked.
       *
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:30:11 UTC 2025
    - 17.8K bytes
    - Viewed (0)
  4. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceFactoryTest.java

            .body("data: hello\n\n")
            .setHeader("content-type", "text/event-stream")
            .build()
        );
        Request request = new Request.Builder().url(server.url("/")).build();
        CompletableFuture<Void> future = new CompletableFuture<>();
        factory.newEventSource(request, new EventSourceListener() {
          @Override
          public void onOpen(@NotNull EventSource eventSource, @NotNull Response response) {
            try {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 2.8K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/fess/opensearch/client/SearchEngineClient.java

         *
         * @param request the multi-search request
         * @return a future for the multi-search response
         */
        @Override
        public ActionFuture<MultiSearchResponse> multiSearch(final MultiSearchRequest request) {
            return client.multiSearch(request);
        }
    
        /**
         * Executes a multi-search request asynchronously with a callback.
         *
    Registered: Thu Sep 04 12:52:25 UTC 2025
    - Last Modified: Sun Aug 31 08:19:00 UTC 2025
    - 121.9K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/kt/UploadProgress.kt

        val requestBody: RequestBody = file.asRequestBody(MEDIA_TYPE_PNG)
    
        val request =
          Request
            .Builder()
            .header("Authorization", "Client-ID $IMGUR_CLIENT_ID")
            .url("https://api.imgur.com/3/image")
            .post(ProgressRequestBody(requestBody, progressListener))
            .build()
    
        client.newCall(request).execute().use { response ->
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  7. okhttp-sse/api/okhttp-sse.api

    	public static fun enqueue (Lokhttp3/Call;Lokhttp3/sse/EventSourceListener;)Lokhttp3/sse/EventSource;
    	public static fun process (Lokhttp3/Response;Lokhttp3/sse/EventSourceListener;)V
    	public abstract fun request ()Lokhttp3/Request;
    }
    
    public final class okhttp3/sse/EventSource$Companion {
    	public final fun enqueue (Lokhttp3/Call;Lokhttp3/sse/EventSourceListener;)Lokhttp3/sse/EventSource;
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  8. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

          ),
        )
        val source = newEventSource()
        assertThat(source.request().url.encodedPath).isEqualTo("/")
        listener.assertFailure(code = 401, message = "{\"error\":{\"message\":\"No auth credentials found\",\"code\":401}}")
      }
    
      private fun newEventSource(accept: String? = null): EventSource {
        val builder =
          Request
            .Builder()
            .url(server.url("/"))
        if (accept != null) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/internal/http/ThreadInterruptTest.kt

    import okhttp3.Call
    import okhttp3.Callback
    import okhttp3.DelegatingServerSocketFactory
    import okhttp3.DelegatingSocketFactory
    import okhttp3.OkHttpClient
    import okhttp3.OkHttpClientTestRule
    import okhttp3.Request
    import okhttp3.RequestBody
    import okhttp3.Response
    import okhttp3.mockwebserver.MockResponse
    import okhttp3.mockwebserver.MockWebServer
    import okhttp3.mockwebserver.SocketPolicy
    import okhttp3.testing.PlatformRule
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:30:11 UTC 2025
    - 6.1K bytes
    - Viewed (0)
  10. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourcesHttpTest.kt

          ),
        )
        var request = Request.Builder().url(server.url("/")).build()
        repeat(2) {
          val response = client.newCall(request).execute()
    
          if (response.code == 401) {
            assertThat(response.body.string()).isEqualTo("{\"error\":{\"message\":\"No auth credentials found\",\"code\":401}}")
            request = request.newBuilder().header("Authorization", "XYZ").build()
          } else {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 13:49:38 UTC 2025
    - 3.6K bytes
    - Viewed (0)
Back to top