File

src/core/smart-http.service.ts

Description

A wrapper over the Http service that handles request errors and sets the withCredentials option for any HTTP request

Example

Index

Properties
Methods

Constructor

constructor(http: HttpClient, injector: Injector)
Parameters :
Name Type Optional
http HttpClient No
injector Injector No

Methods

Public delete
delete(url: string, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
options any No {}
Returns : Observable<T>

Observable

Public get
get(url: string, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
options any No {}
Returns : Observable<T>

Observable

Public head
head(url: string, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
options any No {}
Returns : Observable<T>

Observable

Public options
options(url: string, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
options any No {}
Returns : Observable<T>

Observable

Public patch
patch(url: string, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
options any No {}
Returns : Observable<T>

Observable

Public post
post(url: string, body: any, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
body any No
options any No {}
Returns : Observable<T>

Observable

Public put
put(url: string, body: any, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
body any No
options any No {}
Returns : Observable<T>

Observable

Public request
request(url: string, options: any)
Type parameters :
  • T
Parameters :
Name Type Optional Default value
url string No
options any No {}
Returns : Observable<T>

Observable

Properties

Public handleErrors
Default value : true
onHttpError
Type : EventEmitter<any>
Default value : new EventEmitter<any>()
onUnauthorizedRequest
Type : EventEmitter<void>
Default value : new EventEmitter<void>()

result-matching ""

    No results matching ""