HttpRequest

HttpRequest — HttpRequest represents an outgoing request, including URL, method, headers, body, and other request configuration options. Instances should be assumed to be immutable. To modify a HttpRequest, the clone method should be used.

An outgoing HTTP request with an optional typed body.

class HttpRequest<T> {
  constructor(method: string, url: string, third?: T | { headers?: HttpHeaders; reportProgress?: boolean; params?: HttpParams; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; }, fourth?: { headers?: HttpHeaders; reportProgress?: boolean; params?: HttpParams; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; })
  body: T | null
  headers: HttpHeaders
  reportProgress: boolean
  withCredentials: boolean
  responseType: 'arraybuffer' | 'blob' | 'json' | 'text'
  method: string
  params: HttpParams
  urlWithParams: string
  url: string
  serializeBody(): ArrayBuffer | Blob | FormData | string | null
  detectContentTypeHeader(): string | null
  clone(update: { headers?: HttpHeaders; reportProgress?: boolean; params?: HttpParams; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; body?: any; method?: string; url?: string; setHeaders?: { ...; }; setParams?: { ...; }; } = {}): HttpRequest<any>
}

Related concepts

HttpRequest — Structure map

Clickable & Draggable!

HttpRequest — Related pages: