Options
All
  • Public
  • Public/Protected
  • All
Menu

@azure/core-http - v1.0.3

Package version

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

Authenticator

Authenticator: function

Type declaration

    • (challenge: object): Promise<string>
    • Parameters

      • challenge: object

      Returns Promise<string>

HttpMethods

HttpMethods: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "TRACE"

HttpRequestBody

HttpRequestBody: Blob | string | ArrayBuffer | ArrayBufferView | function

Mapper

MapperType

ParameterPath

ParameterPath: string | string[] | object

PropertyParent

PropertyParent: object

Type declaration

  • [propertyName: string]: any

ProxyAgent

ProxyAgent: object

Type declaration

ProxyOptions

ProxyOptions: ProxySettings

RawHttpHeaders

RawHttpHeaders: object

A HttpHeaders collection represented as a simple JSON object.

Type declaration

  • [headerName: string]: string

RequestPolicyFactory

RequestPolicyFactory: object

Creates a new RequestPolicy per-request that uses the provided nextPolicy.

Type declaration

TelemetryInfo

TelemetryInfo: object

Type declaration

TransferProgressEvent

TransferProgressEvent: object

Fired in response to upload or download progress.

Type declaration

Variables

Const MapperType

MapperType: object = strEnum(["Base64Url","Boolean","ByteArray","Composite","Date","DateTime","DateTimeRfc1123","Dictionary","Enum","Number","Object","Sequence","String","Stream","TimeSpan","UnixTime"])

Type declaration

Const TokenRefreshBufferMs

TokenRefreshBufferMs: number = 2 * 60 * 1000

Defines the default token refresh buffer duration.

Const defaultJsonContentTypes

defaultJsonContentTypes: Object = ["application/json", "text/json", "text/plain"]

Const defaultXmlContentTypes

defaultXmlContentTypes: Object = ["application/xml", "application/atom+xml"]

Const getDefaultUserAgentHeaderName

getDefaultUserAgentHeaderName: getDefaultUserAgentKey = getDefaultUserAgentKey

Const isNode

isNode: boolean = typeof process !== "undefined" &&!!process.version &&!!process.versions &&!!process.versions.node

A constant that indicates whether the environment is node.js or browser based.

Const logger

logger: any = createClientLogger("core-http")

Functions

applyMixins

  • applyMixins(targetCtor: any, sourceCtors: any[]): void
  • Applies the properties on the prototype of sourceCtors to the prototype of targetCtor

    Parameters

    • targetCtor: any

      The target object on which the properties need to be applied.

    • sourceCtors: any[]

      An array of source objects from which the properties need to be taken.

    Returns void

bearerTokenAuthenticationPolicy

  • bearerTokenAuthenticationPolicy(credential: TokenCredential, scopes: string | string[]): RequestPolicyFactory

createPipelineFromOptions

createProxyAgent

createTunnel

  • createTunnel(isRequestHttps: boolean, isProxyHttps: boolean, tunnelOptions: tunnel.HttpsOverHttpsOptions): http.Agent | https.Agent
  • Parameters

    • isRequestHttps: boolean
    • isProxyHttps: boolean
    • tunnelOptions: tunnel.HttpsOverHttpsOptions

    Returns http.Agent | https.Agent

decodeString

  • decodeString(value: string): Uint8Array
  • Decodes a base64 string into a byte array.

    Parameters

    • value: string

      the base64 string to decode

    Returns Uint8Array

delay

  • delay<T>(t: number, value?: T): Promise<T>
  • A wrapper for setTimeout that resolves a promise after t milliseconds.

    Type parameters

    • T

    Parameters

    • t: number

      The number of milliseconds to be delayed.

    • Optional value: T

      The value to be resolved with after a timeout of t milliseconds.

    Returns Promise<T>

    Resolved promise

deserializationPolicy

deserializeResponseBody

encodeByteArray

  • encodeByteArray(value: Uint8Array): string
  • Encodes a byte array in base64 format.

    Parameters

    • value: Uint8Array

      the Uint8Aray to encode

    Returns string

encodeString

  • encodeString(value: string): string
  • Encodes a string in base64 format.

    Parameters

    • value: string

      the string to encode

    Returns string

encodeUri

  • encodeUri(uri: string): string
  • Encodes an URI.

    Parameters

    • uri: string

      The URI to be encoded.

    Returns string

    The encoded URI.

executePromisesSequentially

  • executePromisesSequentially(promiseFactories: Array<any>, kickstart: any): any

exponentialRetryPolicy

  • exponentialRetryPolicy(retryCount?: undefined | number, retryInterval?: undefined | number, maxRetryInterval?: undefined | number): RequestPolicyFactory

flattenResponse

generateClientRequestIdPolicy

generateUuid

  • generateUuid(): string

getDefaultProxySettings

  • getDefaultProxySettings(proxyUrl?: undefined | string): ProxySettings | undefined

getDefaultUserAgentKey

  • getDefaultUserAgentKey(): string

getDefaultUserAgentValue

  • getDefaultUserAgentValue(): string

getOperationArgumentValueFromParameterPath

getPathStringFromParameter

  • Get the path to this parameter's value as a dotted string (a.b.c).

    Parameters

    Returns string

    The path to this parameter's value as a dotted string.

getPathStringFromParameterPath

getPlatformSpecificData

getPropertyParent

isAlphaNumericCharacter

  • isAlphaNumericCharacter(character: string): boolean
  • Get whether or not the provided character (single character string) is an alphanumeric (letter or digit) character.

    Parameters

    • character: string

    Returns boolean

isDuration

  • isDuration(value: string): boolean
  • Indicates whether the given string is in ISO 8601 format.

    Parameters

    • value: string

      The value to be validated for ISO 8601 duration format.

    Returns boolean

    true if valid, false otherwise.

isPrimitiveType

  • isPrimitiveType(value: any): boolean
  • Determines whether the given entity is a basic/primitive type (string, number, boolean, null, undefined).

    Parameters

    • value: any

      Any entity

    Returns boolean

    • true is it is primitive type, false otherwise.

isStreamOperation

isUrlHttps

  • isUrlHttps(url: string): boolean

isValidUuid

  • isValidUuid(uuid: string): boolean
  • Validates the given uuid as a string

    Parameters

    • uuid: string

      The uuid as a string that needs to be validated

    Returns boolean

    True if the uuid is valid; false otherwise.

keepAlivePolicy

logPolicy

operationOptionsToRequestOptionsBase

parseHeaders

parseXML

  • parseXML(str: string, opts?: undefined | object): Promise<any>
  • Converts given XML string into JSON

    Parameters

    • str: string

      String containing the XML content to be parsed into JSON

    • Optional opts: undefined | object

      Options that govern the parsing of given xml string includeRoot indicates whether the root element is to be included or not in the output

    Returns Promise<any>

prepareXMLRootList

  • prepareXMLRootList(obj: any, elementName: string): object
  • Parameters

    • obj: any
    • elementName: string

    Returns object

promiseToCallback

  • promiseToCallback(promise: Promise<any>): Function
  • Converts a Promise to a callback.

    deprecated

    generated code should instead depend on responseToBody

    Parameters

    • promise: Promise<any>

      The Promise to be converted to a callback

    Returns Function

    A function that takes the callback (cb: Function): void

promiseToServiceCallback

  • Converts a Promise to a service callback.

    Type parameters

    • T

    Parameters

    • promise: Promise<HttpOperationResponse>

      The Promise of HttpOperationResponse to be converted to a service callback

    Returns Function

    A function that takes the service callback (cb: ServiceCallback): void

proxyPolicy

redirectPolicy

replaceAll

  • replaceAll(value: string | undefined, searchValue: string, replaceValue: string): string | undefined
  • Replace all of the instances of searchValue in value with the provided replaceValue.

    Parameters

    • value: string | undefined

      The value to search and replace in.

    • searchValue: string

      The value to search for in the value argument.

    • replaceValue: string

      The value to replace searchValue with in the value argument.

    Returns string | undefined

    The value where each instance of searchValue was replaced with replacedValue.

rpRegistrationPolicy

serializeObject

  • serializeObject(toSerialize: any): any

serializeRequestBody

signingPolicy

stringifyXML

  • stringifyXML(obj: any, opts?: undefined | object): any
  • Converts given JSON object to XML string

    Parameters

    • obj: any

      JSON object to be converted into XML string

    • Optional opts: undefined | object

      Options that govern the parsing of given JSON object rootName indicates the name of the root element in the resulting XML

    Returns any

stripRequest

  • Returns a stripped version of the Http Request that does not contain the Authorization header.

    Parameters

    Returns WebResource

    The stripped version of Http Request.

stripResponse

  • Returns a stripped version of the Http Response which only contains body, headers and the status.

    Parameters

    Returns any

    The stripped version of Http Response.

systemErrorRetryPolicy

  • systemErrorRetryPolicy(retryCount?: undefined | number, retryInterval?: undefined | number, minRetryInterval?: undefined | number, maxRetryInterval?: undefined | number): RequestPolicyFactory

throttlingRetryPolicy

tracingPolicy

urlIsHTTPS

  • urlIsHTTPS(urlToCheck: object): boolean
  • Checks if a parsed URL is HTTPS

    Parameters

    • urlToCheck: object

      The url to check

    Returns boolean

    True if the URL is HTTPS; false otherwise.

userAgentPolicy

Object literals

Const Constants

Constants: object

HTTP

HTTP: string = "http:"

Specifies HTTP.

const
type

{string}

HTTPS

HTTPS: string = "https:"

Specifies HTTPS.

const
type

{string}

HTTPS_PROXY

HTTPS_PROXY: string = "HTTPS_PROXY"

Specifies HTTPS Proxy.

const
type

{string}

HTTP_PROXY

HTTP_PROXY: string = "HTTP_PROXY"

Specifies HTTP Proxy.

const
type

{string}

coreHttpVersion

coreHttpVersion: string = "1.0.3"

The core-http version

const
type

{string}

HeaderConstants

HeaderConstants: object

Defines constants for use with HTTP headers.

AUTHORIZATION

AUTHORIZATION: string = "authorization"

The Authorization header.

const
type

{string}

AUTHORIZATION_SCHEME

AUTHORIZATION_SCHEME: string = "Bearer"

RETRY_AFTER

RETRY_AFTER: string = "Retry-After"

The Retry-After response-header field can be used with a 503 (Service Unavailable) or 349 (Too Many Requests) responses to indicate how long the service is expected to be unavailable to the requesting client.

const
type

{string}

USER_AGENT

USER_AGENT: string = "User-Agent"

The UserAgent header.

const
type

{string}

HttpConstants

HttpConstants: object

HttpVerbs

HttpVerbs: object

Http Verbs

const
enum

{string}

DELETE

DELETE: string = "DELETE"

GET

GET: string = "GET"

HEAD

HEAD: string = "HEAD"

MERGE

MERGE: string = "MERGE"

PATCH

PATCH: string = "PATCH"

POST

POST: string = "POST"

PUT

PUT: string = "PUT"

StatusCodes

StatusCodes: object

TooManyRequests

TooManyRequests: number = 429

Const DefaultDeserializationOptions

DefaultDeserializationOptions: object

expectedContentTypes

expectedContentTypes: object

json

json: Object = defaultJsonContentTypes

xml

xml: Object = defaultXmlContentTypes

Const DefaultKeepAliveOptions

DefaultKeepAliveOptions: object

enable

enable: true = true

Const DefaultRedirectOptions

DefaultRedirectOptions: object

handleRedirects

handleRedirects: true = true

maxRetries

maxRetries: number = 20

Const DefaultRetryOptions

DefaultRetryOptions: object

maxRetries

maxRetries: number = DEFAULT_CLIENT_RETRY_COUNT

maxRetryDelayInMs

maxRetryDelayInMs: number = DEFAULT_CLIENT_MAX_RETRY_INTERVAL

retryDelayInMs

retryDelayInMs: number = DEFAULT_CLIENT_RETRY_INTERVAL

Generated using TypeDoc