Http request: "Response with status: 0 for URL: null"


#1

Hello!

When i try to make an http request with the following code:

  getValuations(token: string, limit: number, page: number, orderBy: string, filter: string) {
        var headers = new Headers();
        headers.append('Accept', 'application/json');
        headers.append('Authorization', 'Bearer ' + token);
        let options = new RequestOptions({ headers: headers });
        return this.http.get(this.api_base + '/request/v1/valuation/?limit=' + limit + '&page=' + page + "&orderBy=" + orderBy + "&filter=" + filter, options).map(res => res.json());
    }

I get as response:

Response with status: 0 for URL: null

This happens only when i use the command "ionic cordova run Android --livereload --consolelogs"
When i build the app without livereload and consolelogs it works just fine. This happens on both Android and iOS.

I hope someone can help me with this issue.


#2

Unclear http errors generally indicate cors issues which does not explain why it does work without the flags

So, no clue other than this


#3

Thank you for your reply! I will keep trying to try some things with cors. But this is very weird.