Package arc.util
Class Http
java.lang.Object
arc.util.Http
Utility class for making HTTP requests.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Provides all HTTP methods to use when creating aHttp.HttpRequest
.static class
static class
static enum
Defines the status of an HTTP request.static class
Exception returned when a 4xx or 5xx error is encountered. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Http.HttpRequest
static void
get
(String url, ConsT<Http.HttpResponse, Exception> callback) Creates and submits a HTTP GET request.static void
Creates and submits a HTTP GET request, with an error handler.static Http.HttpRequest
static void
post
(String url, ConsT<Http.HttpResponse, Exception> callback) Creates and submits a HTTP POST request.static Http.HttpRequest
static Http.HttpRequest
request
(Http.HttpMethod method, String url)
-
Field Details
-
exec
-
-
Constructor Details
-
Http
public Http()
-
-
Method Details
-
request
- Returns:
- a new HttpRequest that must be configured & submitted.
-
get
- Returns:
- a new GET HttpRequest that must be configured & submitted.
-
get
Creates and submits a HTTP GET request. -
get
public static void get(String url, ConsT<Http.HttpResponse, Exception> callback, Cons<Throwable> error) Creates and submits a HTTP GET request, with an error handler. -
post
- Returns:
- a new POST HttpRequest that must be configured & submitted.
-
post
Creates and submits a HTTP POST request. -
post
- Returns:
- a new POST HttpRequest that must be configured & submitted.
-