@Immutable @Loggable(value=1) public final class BaseRequest extends Object implements Request
Request.Request,
Response| Modifier and Type | Method and Description |
|---|---|
RequestBody |
body()
Get request body.
|
Response |
fetch()
Execute it with a specified HTTP method.
|
Response |
fetch(InputStream stream)
Execute this request using the content provided by the
InputStream being passed as the request body. |
Request |
header(String name,
Object value)
Set request header.
|
Request |
method(String method)
Use this method.
|
RequestBody |
multipartBody()
Get multipart form (multipart/form-data) body.
|
Request |
reset(String name)
Remove all headers with this name.
|
<T extends Wire> |
through(Class<T> type,
Object... args)
Send it through a decorating
Wire. |
Request |
timeout(int cnct,
int rdd)
Use this timeout values.
|
String |
toString() |
RequestURI |
uri()
Get destination URI.
|
public RequestURI uri()
Requestpublic Request header(String name, Object value)
Requestpublic Request reset(String name)
Requestpublic RequestBody body()
Requestpublic RequestBody multipartBody()
RequestmultipartBody in interface Requestpublic Request method(String method)
Requestpublic Request timeout(int cnct, int rdd)
Requestpublic Response fetch() throws IOException
Requestfetch in interface RequestIOException - If fails to fetch HTTP requestpublic Response fetch(InputStream stream) throws IOException
RequestInputStream being passed as the request body. Note that the
request MUST have an empty body when this method is being invoked, or
it will throw an IllegalStateException.fetch in interface Requeststream - The input stream to useIOException - If fails to fetch HTTP requestpublic <T extends Wire> Request through(Class<T> type, Object... args)
RequestWire.Copyright © 2012–2017 jcabi.com. All rights reserved.