The JSON response works as expected
axios.get('https://rallycoding.herokuapp.com/api/music_albums')
.then(response => console.log(response))
Not able to get response may be because it's XML?
axios.get('http://thefederalistpapers.org/feed')
.then(response => console.log(response))
Does axios work to fetch XML feed?
Here is the error I am getting:
Possible Unhandled Promise Rejection (id: 0):
Error: Network Error
Basically what I am trying to do is, get the XML from HTTP request and I am not sure how to convert it to JSON
I even tried this react-native-xml2js but did not help because it doesn't support async, not sure.
async (default false): Should the callbacks be async? This might be an incompatible change if your code depends on sync execution of callbacks. Future versions of xml2js might change this default, so the recommendation is to not depend on sync execution anyway. Added in 0.2.6.