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 Details

    • defaults

      public HttpDefaults defaults
      Live runtime defaults initialized from app-level `$http` configuration.
    • pendingRequests

      public elemental2.core.JsArray<HttpRequestConfig> pendingRequests
      Requests currently in flight.
  • Constructor Details

    • HttpService

      public HttpService()
  • Method Details

    • call

      public <T> elemental2.promise.Promise<HttpResponse<T>> call(HttpRequestConfig config)
      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

      public <T> elemental2.promise.Promise<HttpResponse<T>> get(String url, HttpRequestOptions config)
      Send a `GET` request.
      Parameters:
      url - Value supplied for the url parameter.
      config - Value supplied for the config parameter.
      Returns:
      Method result.
    • head

      public <T> elemental2.promise.Promise<HttpResponse<T>> head(String url, HttpRequestOptions config)
      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.