React + http api calls

What’s the best way to make an http API call from a react ionic app? I looked into axios but was having trouble getting it to work. Is there an example anywhere?

1 Like

Axios seems fine to me.

Most of the react documentation uses fetch.

See here:

Depending upon your setup you might find it easier to work with a stack like Firebase or amplify as they have decent documentation and are ready to roll with specific SDKs. Just a thought!

Thanks. And do you suggest I create an ionic service for the API call?

Yeah I would do something like that I guess.

This is something I found just off the top…

Seems like a reasonable approach…

Are you coming from the Angular world?

use reacthooks…

1 Like

This is the best & quick tutorial to call rest API in ionic react application using Axios.