All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.internal.request.RequestHolder Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.internal.request;

import com.ning.http.client.AsyncCompletionHandler;
import com.google.common.util.concurrent.ListenableFuture;
import io.sphere.client.SphereResult;

/** Abstraction over HTTP request execution. Allows for mocking in tests. */
// This interface is split into two interfaces because it logically has two parts:
// tests only care about TestableRequestHolder.
public interface RequestHolder extends TestableRequestHolder {
    /** Adds a parameter to the request query string. */
    RequestHolder addQueryParameter(String name, String value);

    /** Sets a body for this request. */
    RequestHolder setBody(String requestBody);

    /** Executes a request to a server. */
    ListenableFuture> executeRequest(AsyncCompletionHandler> onResponse) throws Exception;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy