p.location-badge.
exported from angular2/http
defined in angular2/src/http/http.ts (line 33)
:markdown
The http module provides services to perform http requests. To get started, see the Http
class.
.l-main-section
h2 Annotations
.l-sub-section
h3.annotation Injectable
pre.prettyprint
code.
@Injectable()
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_backend: ConnectionBackend, _defaultOptions: RequestOptions)
:markdown
.l-sub-section
h3 request
pre.prettyprint
code.
request(url: string | Request, options?: RequestOptionsArgs)
:markdown
Performs any type of http request. First argument is required, and can either be a url or
a Request
instance. If the first argument is a url, an optional RequestOptions
object can be provided as the 2nd argument. The options object will be merged with the values
of BaseRequestOptions
before performing the request.
.l-sub-section
h3 get
pre.prettyprint
code.
get(url: string, options?: RequestOptionsArgs)
:markdown
Performs a request with `get` http method.
.l-sub-section
h3 post
pre.prettyprint
code.
post(url: string, body: string, options?: RequestOptionsArgs)
:markdown
Performs a request with `post` http method.
.l-sub-section
h3 put
pre.prettyprint
code.
put(url: string, body: string, options?: RequestOptionsArgs)
:markdown
Performs a request with `put` http method.
.l-sub-section
h3 delete
pre.prettyprint
code.
delete(url: string, options?: RequestOptionsArgs)
:markdown
Performs a request with `delete` http method.
.l-sub-section
h3 patch
pre.prettyprint
code.
patch(url: string, body: string, options?: RequestOptionsArgs)
:markdown
Performs a request with `patch` http method.
.l-sub-section
h3 head
pre.prettyprint
code.
head(url: string, options?: RequestOptionsArgs)
:markdown
Performs a request with `head` http method.