angularhttp-headersresponsehttp-getangular-httpclient

HttpErrorResponse{headers: {…}, status: 0, statusText: "Unknown Error", url: null, …}


I am having an HttpErrorResponse with status code:0 and message:"Http failure response for https://api.ipify.org?format=json: 0 Unknown Error". I found this to be the case with multiple APIs I tried.

I am quite new to angular so it might be just some rookie error but i have tried alot of things for the last 7 days. And none of them works. So please help. Any help will be appreciated. thanks! Here is the full error and code link

Code : stackblitz link

Error:

HttpErrorResponse{headers: {…}, status: 0, statusText: "Unknown Error", url: null, …}
error: ProgressEvent
headers: HttpHeaders
message: "Http failure response for (unknown url): 0 Unknown Error"
name: "HttpErrorResponse"
ok: false
status: 0
statusText: "Unknown Error"
url: null
<prototype>: HttpErrorResponse

Solution

  • I found the real answer well... i found it way earlier but thought i should post it here it generally means that the host your trying to connect is not available most of the time.