public static class SimpleRestClient.RequestBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
SimpleRestClient.RequestBuilder |
accept(String contentType)
Sets a custom content type as Accept header
|
SimpleRestClient.RequestBuilder |
acceptJson()
Sets the accept content type to application/json
|
SimpleRestClient.RequestBuilder |
addHeader(String name,
String value)
Adds a custom header to the request
|
SimpleRestClient.RequestBuilder |
auth(String authToken)
Specifies a custom auth token to set as Authorization information on the request
|
SimpleRestClient.RequestBuilder |
basicAuth(String username,
String password)
Specifies basic authentication information to be added to the request
|
SimpleRestClient.RequestBuilder |
contentType(String contentType)
Sets a custom content type as Content-Type header
|
SimpleRestClient.Response |
delete()
Finalizes and sends a DELETE request
|
SimpleRestClient.Response |
get()
Finalizes and sends a GET request
|
SimpleRestClient.Response |
head()
Finalizes and sends a HEAD request
|
SimpleRestClient.Response |
post(io.devcon5.commons.rest.SimpleRestClient.CheckedConsumer<OutputStream> dataProvider)
Finalizes and sends a POST request
|
SimpleRestClient.Response |
put(io.devcon5.commons.rest.SimpleRestClient.CheckedConsumer<OutputStream> dataProvider)
Finalizes and sends a PUT request
|
SimpleRestClient.RequestBuilder |
sendJson()
Sets the sent content's type to application/json
|
public SimpleRestClient.RequestBuilder basicAuth(String username, String password)
username - the plain text usernamepassword - the plaintext passwordpublic SimpleRestClient.RequestBuilder auth(String authToken)
authToken - the authToken used as 'Authorization' headerpublic SimpleRestClient.RequestBuilder acceptJson()
public SimpleRestClient.RequestBuilder accept(String contentType)
contentType - the accepted content type(s)public SimpleRestClient.RequestBuilder sendJson()
public SimpleRestClient.RequestBuilder contentType(String contentType)
contentType - the content type to be setpublic SimpleRestClient.RequestBuilder addHeader(String name, String value)
name - the name of the header fieldvalue - the value of the header fieldpublic SimpleRestClient.Response get()
public SimpleRestClient.Response head()
public SimpleRestClient.Response delete()
public SimpleRestClient.Response post(io.devcon5.commons.rest.SimpleRestClient.CheckedConsumer<OutputStream> dataProvider)
dataProvider - a data provider that writes to the output stream of the outgoing requestpublic SimpleRestClient.Response put(io.devcon5.commons.rest.SimpleRestClient.CheckedConsumer<OutputStream> dataProvider)
dataProvider - a data provider that writes to the output stream of the outgoing requestCopyright © 2017–2018 DevCon5 GmbH. All rights reserved.