Package com.oracle.bmc.http.client
Interface HttpRequest
-
public interface HttpRequestSetup builder for a HTTP request, to be executed withexecute().A
HttpRequestmust be eitherexecutedordiscardedto clean up all resources associated with it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpRequestappendPathPart(String encodedPathPart)Objectattribute(String name)HttpRequestattribute(String name, Object value)Objectbody()HttpRequestbody(InputStream body, long contentLength)HttpRequestbody(Object body)HttpRequestcopy()Create a new copy of thisHttpRequestwith independent request properties.voiddiscard()Discard this request, signalling that it won’t beexecuted.CompletionStage<HttpResponse>execute()HttpRequestheader(String name, String value)Map<String,List<String>>headers()Methodmethod()HttpRequestoffloadExecutor(Executor executor)Executor to offload some work onto (mostly for better stack traces)HttpRequestquery(String name, String value)Add a query parameter.HttpRequestremoveAttribute(String name)URIuri()
-
-
-
Method Detail
-
method
Method method()
-
body
HttpRequest body(Object body)
-
body
HttpRequest body(InputStream body, long contentLength)
-
body
Object body()
-
appendPathPart
HttpRequest appendPathPart(String encodedPathPart)
-
query
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.
-
uri
URI uri()
-
header
HttpRequest header(String name, String value)
-
removeAttribute
HttpRequest removeAttribute(String name)
-
attribute
HttpRequest attribute(String name, Object value)
-
offloadExecutor
HttpRequest offloadExecutor(Executor executor)
Executor to offload some work onto (mostly for better stack traces)
-
copy
HttpRequest copy()
Create a new copy of thisHttpRequestwith 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).
-
discard
void discard()
Discard this request, signalling that it won’t beexecuted.Any resources associated with this request may be released.
-
execute
CompletionStage<HttpResponse> execute()
-
-