
io.sphere.internal.request.RequestHolder Maven / Gradle / Ivy
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 - 2025 Weber Informatics LLC | Privacy Policy