Top Description Methods
com.oracle.bmc.http.client

public Interface HttpRequest

Imports
java.io.InputStream, java.net.URI, java.util.List, .Map, java.util.concurrent.CompletionStage, .Executor

Setup builder for a HTTP request, to be executed with execute().

A HttpRequest must be either executed or discarded to clean up all resources associated with it.

Method Summary

Modifier and TypeMethod and Description
public HttpRequest
appendPathPart(String encodedPathPart)

public Object
public HttpRequest
attribute(String name, Object value)

public HttpRequest
body(Object body)

public HttpRequest
body(InputStream body, long contentLength)

public Object
body()

public HttpRequest
copy()

Create a new copy of this HttpRequest with independent request properties.

public void
discard()

Discard this request, signalling that it won't be executed.

public CompletionStage<HttpResponse>
public HttpRequest
header(String name, String value)

public Map<String, List<String>>
public Method
public HttpRequest
offloadExecutor(Executor executor)

Executor to offload some work onto (mostly for better stack traces)

public HttpRequest
query(String name, String value)

Add a query parameter.

public HttpRequest
public URI
uri()

Method Detail

appendPathPartback to summary
public HttpRequest appendPathPart(String encodedPathPart)
attributeback to summary
public Object attribute(String name)
attributeback to summary
public HttpRequest attribute(String name, Object value)
bodyback to summary
public HttpRequest body(Object body)
bodyback to summary
public HttpRequest body(InputStream body, long contentLength)
bodyback to summary
public Object body()
copyback to summary
public HttpRequest copy()

Create a new copy of this HttpRequest with independent request properties. For example, you can add a new header to the copied request without affecting this one, and execute them independently. Note that the copied request must be either executed or discarded (just like this one).

discardback to summary
public void discard()

Discard this request, signalling that it won't be executed. Any resources associated with this request may be released.

executeback to summary
public CompletionStage<HttpResponse> execute()
headerback to summary
public HttpRequest header(String name, String value)
headersback to summary
public Map<String, List<String>> headers()
methodback to summary
public Method method()
offloadExecutorback to summary
public HttpRequest offloadExecutor(Executor executor)

Executor to offload some work onto (mostly for better stack traces)

queryback to summary
public HttpRequest query(String name, String value)

Add a query parameter. May be called multiple times for the same name.

Note

name and value must already be percent-encoded.

removeAttributeback to summary
public HttpRequest removeAttribute(String name)
uriback to summary
public URI uri()