{"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":<my-server-url>,"ok":false,"name":"HttpErrorResponse","message":"Http failure response for <my-server-url>: 0 Unknown Error","error":{"isTrusted":true}}
Does <my-server-url>
start with “https://”? If not, does the problem persist when it does?
add the url and how made http request
here is the code snippest
import { HttpClient } from ‘@angular/common/http’;
…
getPost(): Observable <any>{
return this.httpClient.get(url);
}
and url: http://ec2-3-22-79-88.us-east-2.compute.amazonaws.com:9000/in/topnews
below is the code snippest. It works fine with browser. But it is not working in emulator and anrroid device.
could you check is this to deal with CORS? if CORS need to handle from server to accept from different origin.
look for this link.
CROSS is enabled in the server side. And I can access the above-mentioned URL from the browser and device browser. I am seeing this problem only in emulator and device app.
soluation: