Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IRestApi

Set of actions to interact with Rest API endpoints supported by Gondola

experimental

v1 > Can be changed or removed soon

Hierarchy

  • IRestApi

Index

Methods

checkResponseStatus

  • checkResponseStatus(response: any, expected: number): void
  • Parses response data.

    experimental

    v1 > Can be changed or removed soon

    Parameters

    • response: any

      data response from server

    • expected: number

      expected status value

    Returns void

sendDeleteRequest

  • sendDeleteRequest(url: string, headers: {}): Promise<{ body: any; header: any; status: number }>
  • Sends a DELETE request.

    experimental

    v1 > Can be changed or removed soon

    Parameters

    • url: string

      endpoint address

    • headers: {}

      header parameters

    Returns Promise<{ body: any; header: any; status: number }>

sendGetRequest

  • sendGetRequest(url: string, headers: {}): Promise<{ body: any; header: any; status: number }>
  • Sends a GET request.

    experimental

    v1 > Can be changed or removed soon

    Parameters

    • url: string

      endpoint address

    • headers: {}

      header parameters

    Returns Promise<{ body: any; header: any; status: number }>

sendPatchRequest

  • sendPatchRequest(url: string, payload: {}, headers: {}): Promise<{ body: any; header: any; status: number }>
  • Sends a PATCH request.

    experimental

    v1 > Can be changed or removed soon

    Parameters

    • url: string

      endpoint address

    • payload: {}

      the request body

    • headers: {}

      header parameters

    Returns Promise<{ body: any; header: any; status: number }>

sendPostRequest

  • sendPostRequest(url: string, payload: {}, headers: {}): Promise<{ body: any; header: any; status: number }>
  • Sends a POST request.

    experimental

    v1 > Can be changed or removed soon

    Parameters

    • url: string

      endpoint address

    • payload: {}

      the request body

    • headers: {}

      header parameters

    Returns Promise<{ body: any; header: any; status: number }>

sendPutRequest

  • sendPutRequest(url: string, payload: {}, headers: {}): Promise<{ body: any; header: any; status: number }>
  • Sends a PUT request.

    experimental

    v1 > Can be changed or removed soon

    Parameters

    • url: string

      endpoint address

    • payload: {}

      the request body

    • headers: {}

      header parameters

    Returns Promise<{ body: any; header: any; status: number }>

setRequestTimeout

  • setRequestTimeout(newTimeout: number): void
  • Sets the timeout for the request.

    experimental

    v1 > Can be changed or removed soon

    Parameters

    • newTimeout: number

      timeout in milliseconds

    Returns void