fix(Http): add support for headers

This commit is contained in:
Itay Radotzki
2015-07-02 01:20:09 +03:00
committed by Jeff Cross
parent d381c5fc8a
commit 883b506445
2 changed files with 19 additions and 0 deletions

View File

@ -45,6 +45,11 @@ export class XHRConnection implements Connection {
ObservableWrapper.callNext(this.response, new Response(responseOptions))
});
// TODO(jeffbcross): make this more dynamic based on body type
if (isPresent(req.headers)) {
req.headers.forEach((value, name) => { this._xhr.setRequestHeader(name, value); });
}
this._xhr.send(this.request.text());
}