Constructs a new request builder.
Angular's Http service, used to perform the HTTP request when execute is called.
Appends a value to the existing list of values for a header.
Sets the request's body (and optionally its content type).
By default, the content type is application/json
and the specified content is
serialized with JSON.stringify
.
Deletes all header values for the specified name.
Executes the configured HTTP request.
The Http service with which to execute the request (defaults to the one supplied to the constructor).
Alias of setHeader;
Sets the request's HTTP method (e.g. GET, POST).
Supplies this builder's internal RequestOptions object to the specified function for modification.
This is provided so that request options can be freely modified if the provided chainable methods are not sufficient.
Supplies this builder's internal Headers object to the specified function for modification.
This is provided so that headers can be freely modified if the provided chainable methods are not sufficient.
Alias of setSearchParam.
Sets or overrides the header value for the specified name.
Sets the request's URL.
Generated using TypeDoc
Chainable HTTP request builder.
let res: Observable<Response> = new RequestBuilder(http) .post('http://example.com') // Set the URL .body({ foo: 'bar' }) // POST a JSON body with Content-Type application/json .execute(); // Execute the HTTP request let res2: Observable<Response> = new RequestBuilder(http) .get('http://example.com') .header('Authorization', 'Bearer secret') // Set headers .search('page', 2) // Set search params .search('pageSize', 20) .execute();