Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- postStuff() {
- var body = "username=myusername&password=mypassword";
- var headers = new Headers();
- headers.append('Content-Type', 'application/x-www-form-urlencoded');
- return this.http.post('http://localhost:8000/rest/', body, { headers: headers })
- .map(res => res.json());
- }
- curl -H 'Accept: application/json; indent=4' -u myusername:mypassword http://127.0.0.1:8000/rest/
- return this.http.get('http://127.0.0.1:8000/users/')
- .map(res => res.json())
- return this.http.post('http://127.0.0.1:8000/users/', { headers: headers })
- .map(res => res.json());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement