Skip to content

Instantly share code, notes, and snippets.

@wKoza

wKoza/put.ts Secret

Last active January 14, 2017 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wKoza/8ddfdb184c188bed1295584bb1e4a86c to your computer and use it in GitHub Desktop.
Save wKoza/8ddfdb184c188bed1295584bb1e4a86c to your computer and use it in GitHub Desktop.
const headers = new Headers({'Content-Type': 'application/json'});
const options = new RequestOptions({ headers: headers });
private url = 'api.learn-angular.fr/article/4';
Observable<Article> article$ = this.http.put(url, JSON.stringify(article), options)
.map(() => article)
.catch(this.handleError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment