Constructor and Description |
---|
BaseRequest(Wire wre,
String uri)
Public ctor.
|
BaseRequest(Wire wre,
String uri,
Iterable<Map.Entry<String,String>> headers,
String method,
byte[] body)
Public ctor.
|
BaseRequest(Wire wre,
String uri,
Iterable<Map.Entry<String,String>> headers,
String method,
byte[] body,
int cnct,
int rdd)
Public ctor.
|
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 |
through(Wire wre)
Send it through a decorating
Wire . |
Request |
timeout(int cnct,
int rdd)
Use this timeout values.
|
String |
toString() |
RequestURI |
uri()
Get destination URI.
|
public BaseRequest(Wire wre, String uri)
wre
- Wireuri
- The resource to work withpublic BaseRequest(Wire wre, String uri, Iterable<Map.Entry<String,String>> headers, String method, byte[] body)
wre
- Wireuri
- The resource to work withheaders
- Headersmethod
- HTTP methodbody
- HTTP request bodypublic BaseRequest(Wire wre, String uri, Iterable<Map.Entry<String,String>> headers, String method, byte[] body, int cnct, int rdd)
wre
- Wireuri
- The resource to work withheaders
- Headersmethod
- HTTP methodbody
- HTTP request bodycnct
- Connect timeout for http connectionrdd
- Read timeout for http connectionpublic RequestURI uri()
Request
public Request header(String name, Object value)
Request
public Request reset(String name)
Request
public RequestBody body()
Request
public RequestBody multipartBody()
Request
multipartBody
in interface Request
public Request method(String method)
Request
public Request timeout(int cnct, int rdd)
Request
public Response fetch() throws IOException
Request
fetch
in interface Request
IOException
- If fails to fetch HTTP requestpublic Response fetch(InputStream stream) throws IOException
Request
InputStream
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 Request
stream
- The input stream to useIOException
- If fails to fetch HTTP requestpublic <T extends Wire> Request through(Class<T> type, Object... args)
Request
Wire
.public Request through(Wire wre)
Request
Wire
.Copyright © 2012–2021 jcabi.com. All rights reserved.