Je travaille avec Angular 2 et j'essaie d'envoyer une requête HTTP avec des informations d'identification:
Ce code Angular 1 fonctionne bien, il comprend les informations d'identification:
$http.get("http://some.com/user",{ withCredentials: true})
Selon l'aperçu de l'API, j'ai implémenté ce code Angular 2, mais cela ne comprend pas les informations d'identification:
http.get("http://some.com/user", { headers: myHeaders, credentials: RequestCredentialsOpts.Include }).toRx() .map(res => res.json()) .subscribe( // onNext callback data => this.successHandler(data), // onError callback err => this.failure(err) );
Je travaille avec Angular 2.0.0-alpha.37.
J'utilise [email protected]
;
Si vous ajoutez un code dans xhr_backed.js
, vous pouvez envoyer des "informations d'identification" au serveur
this._xhr.withCredentials = true;
var XHRConnection = (function() { function XHRConnection(req, browserXHR, baseResponseOptions) { ........ this._xhr = browserXHR.build(); this._xhr.withCredentials = true; ........
🙂