Web-error response -> body: "Cannot POST


#1

My code

let body     : string   = "key=insert&name=" + this.name + "&email=" + this.email + "&post=" + this.post,
          type     : string   = "application/x-www-form-urlencoded; charset=UTF-8",
          headers  : any      = new Headers({ 'Content-Type': type}),
          options  : any      = new RequestOptions({ headers: headers }),
          url      : any      = "/var/www/html/ionic/myApp/src/app/add-data.php";
        this.http.post(url,body,options)
        .subscribe((data) => {
          console.log(JSON.stringify(data));
               })

is the above code correct I am getting error like
android response-> console.error: ERROR
[object Object]

web-error response -> body: "Cannot POST /var/www/html/ionic/myApp/src/app/add-data.php 404 not found if I copy thislink on web it will directly download the file


Executing using sqliteObject and sqlite
#2

The URL you are POSTing to does not exist. This looks like a path on your local or dev machine. You need something that start with http:// or https://, and when you copy it into your browser it should call the site.