Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

body

body: any

Body to be used when creating a {@link Request}.

headers

headers: Headers | null

{@link Headers} to be attached to a {@link Request}.

method

method: RequestMethod | string | null

Http method with which to execute a {@link Request}. Acceptable methods are defined in the {@link RequestMethod} enum.

params

params: URLSearchParams

Search parameters to be included in a {@link Request}.

responseType

responseType: ResponseContentType | null

search

search: URLSearchParams
deprecated

from 4.0.0. Use params instead.

url

url: string | null

Url with which to perform a {@link Request}.

withCredentials

withCredentials: boolean | null

Enable use credentials for a {@link Request}.

Methods

merge

  • merge(options?: RequestOptionsArgs): RequestOptions
  • Creates a copy of the RequestOptions instance, using the optional input as values to override existing values. This method will not change the values of the instance on which it is being called.

    Note that headers and search will override existing values completely if present in the options object. If these values should be merged, it should be done prior to calling merge on the RequestOptions instance.

    import {RequestOptions, Request, RequestMethod} from '@angular/http';
    
    const options = new RequestOptions({
      method: RequestMethod.Post
    });
    const req = new Request(options.merge({
      url: 'https://google.com'
    }));
    console.log('req.method:', RequestMethod[req.method]); // Post
    console.log('options.url:', options.url); // null
    console.log('req.url:', req.url); // https://google.com
    

    Parameters

    • Optional options: RequestOptionsArgs

    Returns RequestOptions

Generated using TypeDoc