Set of methods for operating HTTP requests

In an eitri-app, it's important to note that it's only possible to make HTTP requests through these commands. The format is similar to a well-known library called axios.

Hierarchy

  • HttpService

Methods

  • Performs an HTTP DELETE request

    Works similarly to axios

    Notes: Only HTTPS requests are accepted

    You can pass an authentication header through the headers

    Example:

    Eitri.http.delete('https://myaddress.com', { "headers": { "Content-Type": "application/json" } } )
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • url: string

      HTTP address for the request

    • Optional config: HttpConfig

      Additional configurations for the request

    Returns Promise<HttpResponse>

  • Performs an HTTP GET request

    Works similarly to axios

    Notes:

    Only HTTPS requests are accepted

    You can pass an authentication header through the headers

    Example:

    Eitri.http.get('https://myaddress.com')
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • url: string

      HTTP address for the request

    • Optional config: HttpConfig

      Additional configurations for the request

    Returns Promise<HttpResponse>

  • Performs an HTTP HEAD request

    Works similarly to axios

    Notes: Only HTTPS requests are accepted

    You can pass an authentication header through the headers

    Example:

    Eitri.http.head('https://myaddress.com', {"headers": {"Content-Type": "application/json"}})
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • url: string

      HTTP address for the request

    • Optional config: HttpConfig

      Additional configurations for the request

    Returns Promise<HttpResponse>

  • Performs an HTTP OPTIONS request

    Works similarly to axios

    Notes: Only HTTPS requests are accepted

    You can pass an authentication header through the headers

    Example:

    Eitri.http.options('https://myaddress.com', { "headers": { "Content-Type": "application/json" } } )
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • url: string

      HTTP address for the request

    • Optional config: HttpConfig

      Additional configurations for the request

    Returns Promise<HttpResponse>

  • Performs an HTTP PATCH request

    Works similarly to axios

    Notes: Only HTTPS requests are accepted

    You can pass an authentication header through the headers

    Example:

    Eitri.http.patch('https://myaddress.com',
    {
    myData: "value of my data"
    },
    {
    "headers": {"Content-Type": "application/json"}
    }
    )

    Compatibility Control

    • API LEVEL 1 - Functionality added
    • API LEVEL 3 - Adds support for multipart/form-data

    Parameters

    • url: string

      HTTP address for the request

    • Optional data: any

      Data to be sent

    • Optional config: HttpConfig

      Additional configurations for the request

    Returns Promise<HttpResponse>

  • Performs an HTTP POST request

    Works similarly to axios

    Notes: Only HTTPS requests are accepted

    You can pass an authentication header through the headers field

    Example:

    Eitri.http.post('https://myaddress.com',
    {
    myData: "value of my data"
    },
    {
    "headers": {"Content-Type": "application/json"}
    }
    )

    Compatibility Control

    • API LEVEL 1 - Functionality added
    • API LEVEL 3 - Adds support for multipart/form-data

    Parameters

    • url: string

      HTTP address for the request

    • Optional data: any

      Data to be sent

    • Optional config: HttpConfig

      Additional configurations for the request

    Returns Promise<HttpResponse>

  • Performs an HTTP PUT request

    Works similarly to axios

    Notes: Only HTTPS requests are accepted

    You can pass an authentication header through the headers

    Example:

    Eitri.http.put('https://myaddress.com',
    {
    myData: "value of my data"
    },
    {
    "headers": {"Content-Type": "application/json"}
    }
    )

    Compatibility Control

    • API LEVEL 1 - Functionality added
    • API LEVEL 3 - Adds support for multipart/form-data

    Parameters

    • url: string

      HTTP address for the request

    • Optional data: any

      Data to be sent

    • Optional config: HttpConfig

      Additional configurations for the request

    Returns Promise<HttpResponse>

Generated using TypeDoc