Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var JSONObject = {"latitude": "" + lat, "longitude": "" + lng};
- console.log("Posting: " + JSON.stringify(JSONObject));
- let headerOptions: any = { 'Content-Type': 'application/json' };
- let headers = new Headers(headerOptions);
- this.http.get("http://192.168.1.2:8080/location/new1/")
- .map((response: Response) => {
- console.log('Response is: ' + response);
- })
- .catch((this.handleErrorObservable));
- this.http.post("http://192.168.1.2:8080/location/new/", JSON.stringify(JSONObject), new RequestOptions({ headers: headers }))
- .map((response: Response) => {
- console.log('Response is: ' + response);
- })
- .catch((this.handleErrorObservable));
Add Comment
Please, Sign In to add comment