public interface EngineRequest
HttpEngine.
method(String, WebBody) MUST be called before any other function.
Created by covers1624 on 1/8/23.
| Modifier and Type | Method and Description |
|---|---|
EngineResponse |
execute()
Execute the given
EngineRequest. |
HeaderList |
getHeaders()
Get all the headers for this request.
|
java.lang.String |
getUrl()
Get the url for this request.
|
EngineRequest |
header(java.lang.String key,
java.lang.String value)
Add a specific HTTP header to this request.
|
EngineRequest |
headers(HeaderList headers)
Add all the specified HTTP headers to this request.
|
EngineRequest |
headers(java.util.Map<java.lang.String,java.lang.String> headers)
Add all the specified HTTP headers to this request.
|
EngineRequest |
listener(RequestListener listener)
Set a listener to receive progress updates about this transfer.
|
EngineRequest |
method(java.lang.String method,
@Nullable WebBody body)
Sets the HTTP method and
WebBody for this request. |
EngineRequest |
removeHeader(java.lang.String key)
Removes all the specified HTTP headers with the given key.
|
EngineRequest |
url(java.lang.String url)
Set the url for this request.
|
default EngineRequest |
url(java.net.URL url)
Set the
URL for this request. |
EngineRequest method(java.lang.String method, @Nullable @Nullable WebBody body)
WebBody for this request.method - The HTTP method.body - The WebBody.EngineRequest.default EngineRequest url(java.net.URL url)
URL for this request.url - The URL.EngineRequest.EngineRequest url(java.lang.String url)
url - The url.EngineRequest.EngineRequest header(java.lang.String key, java.lang.String value)
key - The key.value - The value.EngineRequest.EngineRequest headers(java.util.Map<java.lang.String,java.lang.String> headers)
headers - The headers to add.EngineRequest.EngineRequest headers(HeaderList headers)
headers - The headers to add.EngineRequest.EngineRequest removeHeader(java.lang.String key)
key - The key.EngineRequest.@ApiStatus.Experimental EngineRequest listener(RequestListener listener)
Note: This API is still experimental, may crash, may not be supported by all http impls, or may change.
listener - The listener.java.lang.String getUrl()
HeaderList getHeaders()
HeaderList collection representing all the headers.EngineResponse execute() throws java.io.IOException
EngineRequest.
This method blocks until the underlying HTTP implementation returns a response, or throws an exception.
EngineResponse for the request.java.io.IOException - Thrown by the underlying HTTP implementation in the event of an error.