public class HttpRestRequest extends Object
| Modifier and Type | Method and Description |
|---|---|
@NotNull HttpRestRequest |
buildRequest(@Nullable HttpMethod httpMethod,
@Nullable String path,
@Nullable org.apache.http.HttpEntity httpEntity)
Build a HTTP request
|
@NotNull HttpRestRequest |
buildRequest(@Nullable HttpMethod httpMethod,
@Nullable URI uri,
@Nullable org.apache.http.HttpEntity httpEntity)
Build a HTTP request
|
static @NotNull HttpRestRequest |
createRequest(@NotNull RestSession session)
Creates a Rest request handling the messages of the given
RestSession |
<T> T |
executeRequest(@Nullable Class<T> type)
Executes the HTTP request
|
void |
executeRequest(@Nullable OutputStream outputStream)
Executes the HTTP request
|
@NotNull HttpRestRequest |
setAcceptHeader(@NotNull String mimeType)
Initializes the MIME type accepted by this REST request and returns a reference to this request.
|
@NotNull public static @NotNull HttpRestRequest createRequest(@NotNull @NotNull RestSession session)
RestSessionsession - the RestSession this Rest request is handling.RestSession@NotNull public @NotNull HttpRestRequest setAcceptHeader(@NotNull @NotNull String mimeType)
mimeType - The MIME type accepted by this REST request.@NotNull public @NotNull HttpRestRequest buildRequest(@Nullable @Nullable HttpMethod httpMethod, @Nullable @Nullable String path, @Nullable @Nullable org.apache.http.HttpEntity httpEntity) throws ResultException
httpMethod - HTTP method (GET, POST, ...)path - REST resource URLhttpEntity - data to send with request (POST)ResultException - if the HTTP method is unknown@NotNull public @NotNull HttpRestRequest buildRequest(@Nullable @Nullable HttpMethod httpMethod, @Nullable @Nullable URI uri, @Nullable @Nullable org.apache.http.HttpEntity httpEntity) throws ResultException
httpMethod - HTTP method (GET, POST, ...)uri - REST resource URLhttpEntity - data to send with request (POST)ResultException - if the HTTP method is unknownpublic void executeRequest(@Nullable
@Nullable OutputStream outputStream)
throws ResultException
outputStream - Target stream for the responseResultException - a ResultException@Nullable
public <T> T executeRequest(@Nullable
@Nullable Class<T> type)
throws ResultException
T - class for responsetype - class name for responseResultException - if HTTP entity should be save as fileCopyright © 2017–2022 SoftVision Development GmbH, Fulda, Germany. All rights reserved.