Package org.angular.ts.ng
Class HttpService
java.lang.Object
org.angular.ts.ng.HttpService
@JsType(isNative=true,
name="ng.HttpService",
namespace="<global>")
public class HttpService
extends Object
Runtime `$http` service contract for full request configs, HTTP verb shortcuts, defaults, and pending request tracking.
-
Field Summary
FieldsModifier and TypeFieldDescriptionLive runtime defaults initialized from app-level `$http` configuration.elemental2.core.JsArray<HttpRequestConfig> Requests currently in flight. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> elemental2.promise.Promise<HttpResponse<T>> call(HttpRequestConfig config) Invokes the callable HttpService contract.<T> elemental2.promise.Promise<HttpResponse<T>> delete(String url, HttpRequestOptions config) Send a `DELETE` request.<T> elemental2.promise.Promise<HttpResponse<T>> get(String url, HttpRequestOptions config) Send a `GET` request.<T> elemental2.promise.Promise<HttpResponse<T>> head(String url, HttpRequestOptions config) Send a `HEAD` request.<T> elemental2.promise.Promise<HttpResponse<T>> patch(String url, Object data, HttpRequestOptions config) Send a `PATCH` request with a request body.<T> elemental2.promise.Promise<HttpResponse<T>> post(String url, Object data, HttpRequestOptions config) Send a `POST` request with a request body.<T> elemental2.promise.Promise<HttpResponse<T>> put(String url, Object data, HttpRequestOptions config) Send a `PUT` request with a request body.
-
Field Details
-
defaults
Live runtime defaults initialized from app-level `$http` configuration. -
pendingRequests
Requests currently in flight.
-
-
Constructor Details
-
HttpService
public HttpService()
-
-
Method Details
-
call
Invokes the callable HttpService contract.- Parameters:
config- Value supplied for the config parameter.- Returns:
- Method result.
-
delete
public <T> elemental2.promise.Promise<HttpResponse<T>> delete(String url, HttpRequestOptions config) Send a `DELETE` request.- Parameters:
url- Value supplied for the url parameter.config- Value supplied for the config parameter.- Returns:
- Method result.
-
get
Send a `GET` request.- Parameters:
url- Value supplied for the url parameter.config- Value supplied for the config parameter.- Returns:
- Method result.
-
head
Send a `HEAD` request.- Parameters:
url- Value supplied for the url parameter.config- Value supplied for the config parameter.- Returns:
- Method result.
-
patch
public <T> elemental2.promise.Promise<HttpResponse<T>> patch(String url, Object data, HttpRequestOptions config) Send a `PATCH` request with a request body.- Parameters:
url- Value supplied for the url parameter.data- Value supplied for the data parameter.config- Value supplied for the config parameter.- Returns:
- Method result.
-
post
public <T> elemental2.promise.Promise<HttpResponse<T>> post(String url, Object data, HttpRequestOptions config) Send a `POST` request with a request body.- Parameters:
url- Value supplied for the url parameter.data- Value supplied for the data parameter.config- Value supplied for the config parameter.- Returns:
- Method result.
-
put
public <T> elemental2.promise.Promise<HttpResponse<T>> put(String url, Object data, HttpRequestOptions config) Send a `PUT` request with a request body.- Parameters:
url- Value supplied for the url parameter.data- Value supplied for the data parameter.config- Value supplied for the config parameter.- Returns:
- Method result.
-