Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpParams

An HTTP request/response body that represents serialized parameters, per the MIME type application/x-www-form-urlencoded.

This class is immutable - all mutation operations return a new instance.

Hierarchy

  • HttpParams

Index

Constructors

constructor

Methods

append

  • append(param: string, value: string): HttpParams
  • Construct a new body with an appended value for the given parameter name.

    Parameters

    • param: string
    • value: string

    Returns HttpParams

delete

  • delete(param: string, value?: string): HttpParams
  • Construct a new body with either the given value for the given parameter removed, if a value is given, or all values for the given parameter removed if not.

    Parameters

    • param: string
    • Optional value: string

    Returns HttpParams

get

  • get(param: string): string | null
  • Get the first value for the given parameter name, or null if it's not present.

    Parameters

    • param: string

    Returns string | null

getAll

  • getAll(param: string): string[] | null
  • Get all values for the given parameter name, or null if it's not present.

    Parameters

    • param: string

    Returns string[] | null

has

  • has(param: string): boolean
  • Check whether the body has one or more values for the given parameter name.

    Parameters

    • param: string

    Returns boolean

keys

  • keys(): string[]
  • Get all the parameter names for this body.

    Returns string[]

set

  • Construct a new body with a new value for the given parameter name.

    Parameters

    • param: string
    • value: string

    Returns HttpParams

toString

  • toString(): string
  • Serialize the body to an encoded string, where key-value pairs (separated by =) are separated by &s.

    Returns string

Generated using TypeDoc