there have been some threads on this topic but I couldn’t find a solution.

My problem: I’ve an API (written in PHP) which seems to work. I can send a request and get the data. There is a basic authorization with username/password which works. I can get the data through browser or through postman (or paw which seems to be a nice tool too).

Not I try to call this api-endpoint through my app. The api gets called but doesn’t add the authorization-header no matter what I try. In the firefox dev tools I see that the request is missing the authorization-header. Can anyone enlighten me? Thank you.
My code:

Thanks, I was mixing up some things I guess, I was using HttpClient but just headers. I changed to HttpHeaders() but I have still the same problem. The API gets called, but is missing the Authorization-header.

Spending some more time on this. When I now go on my device or on an emulator, there is no proxy needed anymore, right? There is written a lot on the web and I cannot find a solution. Building my app for iOS works, I can copy it through Xcode to my iPhone but every API-call fails. I just don’t get anything.

I removed the proxy-part from ionic.json.config and used the https-address of the api which works. ionic serve works with the proxy, so the calls and so on should work. I also programmed a log-function in my API and it doesn’t get called.

no, not really. I didn’t have the time to get into it and as it just was a test I kind of gave up a little bit (or wanted to do it later). So I don’t have a solution for that at the moment. But there sure is. Or at least should be.