2
postDataToSheet(data:any)  
{
alert("in sheet");
return this.http.post('https://script.google.com/macros/s/AKfycbxD-6omsA58lyOvJ9dkUyCEQNnAbKJanH_Ddz9xJO5rVuNyYKZv/exec',
data,{headers : new Headers({'Content-Type':'application/jsonp','Access-Control-Allow-Origin':'*','crossDomain':true})}
).subscribe(data=>alert("Successfully Saved"));

I am not able to save data as the request to my spreadsheet is denied because of cross-origin policy.

Is there any other way around to fix the issue????

  • You can't do it becouse using JSONP for do POST. [More info here](http://stackoverflow.com/questions/4508198/how-to-use-type-post-in-jsonp-ajax-call). – Mast Mar 29 '17 at 07:25

0 Answers0