Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var headers = new Headers();
- headers.append('Content-Type', 'application/x-www-form-urlencoded');
- this.http.post('http://localhost/jiffy_fun/laravel/public/token',{headers: headers}).map(res => res.json()).subscribe(res => {this.token = res});
- var creds = "username=" + username + "&password=" + password;
- var headers = new Headers();
- headers.append('Content-Type',
- 'application/x-www-form-urlencoded');
- this.http.post(
- 'http://localhost/jiffy_fun/laravel/public/token',
- creds,
- {headers: headers})
- .map(res => res.json())
- .subscribe(res => {this.token = res});
- let headers = {
- 'Content-Type' : 'application/x-www-form-urlencoded'
- }
- let options = new RequestOptions({ headers: headers, withCredentials: true });
- this.http.post('http://localhost/jiffy_fun/laravel/public/token',JSON.stringify({}),options).map(res => res.json()).subscribe(res => {this.token = res});
- // Http post function declaration
- post(url: string, body: string, options?: RequestOptionsArgs) : Observable<Response>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement