# Angular: HttpErrorResponse — Http failure response for (unknown url): 0 Unknown Error (status 0)

**Code:** `Http failure response for (unknown url): 0 Unknown Error` · **Category:** Angular · **Seen on:** Angular, TypeScript

`HttpClient` got no HTTP response at all: the request was blocked (CORS), failed at network level, or the server is unreachable — status 0 is not a server status.

## Meaning

Status 0 means the browser never delivered a response to JavaScript. Open the Network tab: a red request with a CORS message, a mixed-content or certificate error, an ad blocker, offline mode, a wrong URL/port, or a server crash all show up as `0 Unknown Error`. Fix the underlying network or CORS problem; the message itself carries no detail.

## Common causes

- CORS blocked the request (missing `Access-Control-Allow-Origin` or preflight failing)
- Server down, wrong host or port, or connection refused
- Mixed content (HTTP API called from an HTTPS page) or certificate error
- Ad blocker or browser extension cancelling the request
- Request aborted by a navigation, timeout or offline state

## Quick fix

1. Open DevTools → Network and read the red entry plus the console CORS message
2. Use the dev-server proxy (`proxy.conf.json`) for local API calls
3. Fix CORS headers on the API for your front-end origin

## Detailed fix by platform

### Angular

1. Log the real error: `this.http.get(url).pipe(catchError(e => { console.error(e); return throwError(() => e); }))`
2. Local dev: `ng serve --proxy-config proxy.conf.json`

### Linux

1. Reproduce outside the browser: `curl -v https://api.example.com/data` — if curl works, the cause is CORS/browser-side

## Code examples

### proxy.conf.json

```json
{
  "/api": {
    "target": "http://localhost:3000",
    "secure": false,
    "changeOrigin": true
  }
}
```

## How to diagnose

1. **Network** — What does the Network tab show for the request?
2. **CORS** — Console message about Access-Control?
3. **Server** — Does curl reach the API?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/angular/http-failure-response-0-unknown-error)
