public class Unirest extends Object
Constructor and Description |
---|
Unirest() |
Modifier and Type | Method and Description |
---|---|
static Config |
config()
Access the default configuration for the primary Unirest instance.
|
static HttpRequestWithBody |
delete(String url)
Start a DELETE HttpRequest which supports a body from the primary config
|
static GetRequest |
get(String url)
Start a GET HttpRequest which does not support a body from the primary config
|
static GetRequest |
head(String url)
Start a HEAD HttpRequest which does not support a body from the primary config
|
static boolean |
isRunning()
Does the config have currently running clients? Find out here.
|
static JsonPatchRequest |
jsonPatch(String url)
Start a PATCH HttpRequest which supports a JSON Patch builder.
|
static GetRequest |
options(String url)
Start a OPTIONS HttpRequest which does not support a body from the primary config
|
static HttpRequestWithBody |
patch(String url)
Start a PATCH HttpRequest which supports a body from the primary config
|
static HttpRequestWithBody |
post(String url)
Start a POST HttpRequest which supports a body from the primary config
|
static UnirestInstance |
primaryInstance()
return the primary UnirestInstance.
|
static HttpRequestWithBody |
put(String url)
Start a PUT HttpRequest which supports a body from the primary config
|
static HttpRequestWithBody |
request(String method,
String url) |
static void |
shutDown()
Close the asynchronous client and its event loop.
|
static void |
shutDown(boolean clearOptions)
Close the asynchronous client and its event loop.
|
static UnirestInstance |
spawnInstance()
Spawn a new Unirest Instance with a new config.
|
public static Config config()
public static void shutDown()
public static void shutDown(boolean clearOptions)
clearOptions
- indicates if options should be cleared. Note that the HttpClient, AsyncClient and thread monitors will not be retained after shutDown.public static GetRequest get(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static GetRequest head(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static GetRequest options(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static HttpRequestWithBody post(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static HttpRequestWithBody delete(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static HttpRequestWithBody patch(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static HttpRequestWithBody put(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static JsonPatchRequest jsonPatch(String url)
url
- the endpoint to access. Can include placeholders for path params using curly braces {}public static HttpRequestWithBody request(String method, String url)
public static boolean isRunning()
public static UnirestInstance spawnInstance()
public static UnirestInstance primaryInstance()
Copyright © 2022. All rights reserved.