HttpClient


#1

Are we now required to use HttpClient in ionic@3.9.2? I didn’t find any documentation anywhere.


#2

https://angular.io/guide/http


#3

Thanks – I’m just curious if it’s required with Ionic 3.9.2.

It looks like my old HTTP calls using @angular/http will not add headers anymore and it’s going to be some effort to have to migrate my entire fleet of projects.

Would have been nice to have a heads up w/ the Release Notes or something :frowning:


#4

I see. The patch was for https by default instead of http. So maybe you’re doing something inconsistent with that (or you found a bug).


#5

I’m not entirely sure…it could be the way my API is configured, since other calls with headers do work. I’m just looking up troubleshooting steps to see why the key isn’t being added to my requests, but it might be the way my API is setup.


#6

Code change here.

Edit: oops sorry, just looks like a documentation change.


#7

I apologize, I made a stupid idiot mistake. I forgot the version in my base URL.

However, going forward, it’s recommended to use HttpClient over Http with Ionic, correct? If so, I’ll load both modules into my app and slowly migrate as I can.


#8

Yes. (need 20 characters)


#9

For one thing, the new interceptor functionality will perhaps make your code vastly simpler, because you will be able to do all the header munging in a single place without resorting to tactics like dodgy inheritance kludging.