this error has been bugging me for quite a while now , my post requests are being sent to the server and the response is correct everything works on my browser, however, switching to the actual device the log shows this error which is extremely annoying and i cant trace the problem
ok:false status:0 statusText:"" type:3 url:null
this is my post request syntax
this.http.post(`URLhere?ParamsHere`,null) .do((data:Response)=>console.log(data)) .map((data:Response)=>data.json()) .do((data:Response)=>console.log(data)) .catch((error:Response)=>Observable.throw(error));
it will always go to the catch part and throw the above error . i suspect this is an error due CORS because thats the only difference between my browser and the phone is that i have a plugin on my chrome browser which auto adds CORS acceptance.
using that in the options however would always send a request with Method : OPTIONS and i cant find any post to help me cancel that request , i cant handle it in the back end right now to allow pre flight as this is already deployed and will need alot of effort to be done.
thus my question is, if this error is due to CORS how can i overcome it ? although adding the Allow CORS to my headers will always generate a preflight request which i cant overcome even using text/plain content type
also note that i can see the request being send to my local server from my app and i can see the server replying correctly to the request however once the response is sent from the server this error pops