public class GitlabHTTPRequestor extends Object
| Constructor and Description |
|---|
GitlabHTTPRequestor(GitlabAPI root) |
| Modifier and Type | Method and Description |
|---|---|
<T> Iterator<T> |
asIterator(String tailApiUrl,
Class<T> type) |
GitlabHTTPRequestor |
authenticate(String token,
TokenType type,
AuthMethod method)
Sets authentication data for the request.
|
<T> List<T> |
getAll(String tailUrl,
Class<T[]> type) |
GitlabHTTPRequestor |
method(Method method)
Sets the HTTP Request method for the request.
|
<T> T |
to(String tailAPIUrl,
Class<T> type) |
<T> T |
to(String tailAPIUrl,
Class<T> type,
T instance)
Opens the HTTP(S) connection, submits any data and parses the response.
|
<T> T |
to(String tailAPIUrl,
T instance) |
GitlabHTTPRequestor |
with(String key,
Object value)
Sets the HTTP Form Post parameters for the request
Has a fluent api for method chaining
|
GitlabHTTPRequestor |
withAttachment(String key,
File file)
Sets the HTTP Form Post parameters for the request
Has a fluent api for method chaining
|
public GitlabHTTPRequestor(GitlabAPI root)
public GitlabHTTPRequestor authenticate(String token, TokenType type, AuthMethod method)
token - The token valuetype - The type of the tokenmethod - The authentication methodpublic GitlabHTTPRequestor method(Method method)
method - The HTTP methodpublic GitlabHTTPRequestor with(String key, Object value)
key - Form parameter Keyvalue - Form parameter Valuepublic GitlabHTTPRequestor withAttachment(String key, File file)
key - Form parameter Keyfile - File datapublic <T> T to(String tailAPIUrl, T instance) throws IOException
IOExceptionpublic <T> T to(String tailAPIUrl, Class<T> type) throws IOException
IOExceptionpublic <T> T to(String tailAPIUrl, Class<T> type, T instance) throws IOException
T - The return type of the methodtailAPIUrl - The url to open a connection to (after the host and namespace)type - The type of the response to be deserialized frominstance - The instance to update from the responseIOException - on gitlab api errorCopyright © 2018. All rights reserved.