HTTP service for sending requests to a given URL

By default, the service will work with the JSON data format. If anything but JSON is returned from the endpoint, the responseType property in the options parameter needs to be set.

Hierarchy

  • HttpClient

Methods

Methods

  • Sends a delete request.

    Returns

    Parameters

    • url: string

      Url to resource (for instance my_addon/endpoint).

    • Optional options: HttpOptions

      The HTTP options to send with the request.

    Returns Promise<any>

  • Sends a get request.

    Returns

    Parameters

    • url: string

      Url to resource (for instance my_addon/endpoint).

    • Optional options: HttpOptions

      The HTTP options to send with the request.

    Returns Promise<any>

  • Sends a patch request.

    Returns

    Parameters

    • url: string

      Url to resource (for instance my_addon/endpoint).

    • Optional data: {}

      Payload to send to the server.

      • Optional options: HttpOptions

        The HTTP options to send with the request.

      Returns Promise<any>

    • Sends a post request.

      Returns

      Parameters

      • url: string

        Url to resource (for instance my_addon/endpoint).

      • Optional data: {}

        Payload to send to the server.

        • Optional options: HttpOptions

          The HTTP options to send with the request.

        Returns Promise<any>

      • Sends a put request.

        Returns

        Parameters

        • url: string

          Url to resource (for instance my_addon/endpoint).

        • Optional data: {}

          Payload to send to the server.

          • Optional options: HttpOptions

            The HTTP options to send with the request.

          Returns Promise<any>