Skip to content

Instantly share code, notes, and snippets.

@iworkforthem
Created November 1, 2017 11:08
Show Gist options
  • Select an option

  • Save iworkforthem/d1e1321eb08d87f0153b7c24e1bc6c6b to your computer and use it in GitHub Desktop.

Select an option

Save iworkforthem/d1e1321eb08d87f0153b7c24e1bc6c6b to your computer and use it in GitHub Desktop.
ionic 2 http post
var url = 'http://127.0.0.1:3000/';
var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
let param = 'name=' + this.signup.username + '&email=' + '&mobile=';
this.http.post(url, param, { headers: headers }).subscribe(data => {
console.log(data)
}, error => {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment