Hierarchy

  • HttpApiHandler

Methods

call

  • Call the API method.

    Parameters

    • Optional req: FetchRequest

      Request parameter.

      const response = await Namespace.api. mymethod.call({
          method: 'POST', 
          body: JSON.sringify({ data1: 1,  data2: '2' }) 
      }); 
      

    Returns Promise<FetchResponse>

getUrl

  • getUrl(): string
  • Get links for an external call of the API method.

    Returns string

withFragment

  • withFragment(path: string): this
  • Pass path to the API method.

    Parameters

    • path: string

      Additional path for the method:

      const response = await  Namespace.api.mymethod
        .withFragment('getById/29155') 
        .call({ 
             method: 'GET', 
        }) 
      

    Returns this