Http interface provided in the plugin api

Hierarchy

  • Http

Index

Methods

addAuthenticationHeader

  • addAuthenticationHeader(value: string): void
  • Adds authentication header for the request.

    Parameters

    • value: string

      Value to set to the header

    Returns void

addHeader

  • addHeader(name: string, value: string): void
  • Adds header for the request.

    Parameters

    • name: string

      Name of the header

    • value: string

      Value to set to the header

    Returns void

addParameter

  • addParameter(name: string, value: string): void
  • Adds parameter for the request.

    Parameters

    • name: string

      Name of the parameter

    • value: string

      Value to set for the parameter

    Returns void

addPassword

  • addPassword(password: string): void
  • Sets password to credentials within rest request.

    Parameters

    • password: string

    Returns void

addUserName

  • addUserName(name: string): void
  • Sets username to credentials within rest request.

    Parameters

    • name: string

    Returns void

execute

  • If all needed data is set, performs http request.

    Note that this method blocks further execution of the code.

    Returns ResponseInfo

    All information on the response

performRequest

  • performRequest(): string
  • If all needed data is set, performs http request.

    Note that this method blocks further execution of the code.

    deprecated

    Use Http.execute instead

    Returns string

    The response as string;

reset

  • reset(): void
  • Resets the values set to api.http to default values/empty values

    Returns void

setBody

  • setBody(body: string): void
  • Sets body for the request. By default it is JSON body.

    Parameters

    • body: string

    Returns void

setContentType

  • setContentType(contentType: string): void
  • Sets content type for the request. By default it is "application/json".

    Parameters

    • contentType: string

    Returns void

setMethod

  • Sets request method type.

    Parameters

    Returns void

setProxyPassword

  • setProxyPassword(proxyPassword: string): void
  • Sets password to proxy credentials.

    Parameters

    • proxyPassword: string

    Returns void

setProxyURL

  • setProxyURL(proxyURL: string): void
  • Sets proxy URL

    Parameters

    • proxyURL: string

    Returns void

setProxyUser

  • setProxyUser(proxyUser: string): void
  • Sets username to proxy credentials.

    Parameters

    • proxyUser: string

    Returns void

setURL

  • setURL(url: string): void
  • Sets URL to which the http call will be performed

    Parameters

    • url: string

    Returns void

toJsonArray

  • toJsonArray(stringinJson: string): any[]
  • Converts string if it is in json format to JSON array.

    Helper function to convert response to json if needed.

    Parameters

    • stringinJson: string

    Returns any[]

toJsonObject

  • toJsonObject(stringInJson: string): object
  • Converts string if it is in json format to JSON object.

    Helper function to convert response to json if needed.

    Parameters

    • stringInJson: string

    Returns object

Legend

Generated using TypeDoc