public class RequestBuilder extends Object
| Constructor and Description |
|---|
RequestBuilder() |
RequestBuilder(String url) |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptableRange(int from,
int to)
Specify the acceptable range of response codes.
|
RequestBuilder |
body(Object body)
Adds the request body.
|
RequestBuilder |
cache()
Enables a request cache.
|
RequestBuilder |
cache(long ttlInMs)
Enables a request cache.
|
RequestBuilder |
credentials(String credentialsId)
Add basic authorization based from a jenkins credentials given its id
|
RequestResponse |
delete()
Perform a delete request.
|
RequestResponse |
get()
Perform a get request.
|
RequestBuilder |
header(String key,
String value)
Add a header entry
|
RequestResponse |
patch()
Perform a patch request
|
RequestResponse |
post()
Perform a post request.
|
RequestResponse |
put()
Perform a put request
|
static RequestBuilder |
url(String url) |
public RequestBuilder()
public RequestBuilder(String url)
public static RequestBuilder url(String url)
public RequestBuilder cache()
public RequestBuilder cache(long ttlInMs)
ttlInMs - the cache time to live in millisecondspublic RequestBuilder header(String key, String value)
key - header keyvalue - header valuepublic RequestBuilder credentials(String credentialsId)
credentialsId - the id of the credential to addpublic RequestBuilder body(Object body)
body - the body contentspublic void acceptableRange(int from,
int to)
from - to - public RequestResponse post()
public RequestResponse put()
public RequestResponse patch()
public RequestResponse get()
public RequestResponse delete()
Copyright © 2016–2017. All rights reserved.