All Questions

Tagged with
Filter by
Sorted by
Tagged with
209votes
4answers
314kviews

Axios get in url works but with second parameter as object it doesn't

I'm trying to send GET request as second parameter but it doesn't work while it does as url. This works, $_GET['naam'] returns test: export function saveScore(naam, score) { return function (...
user avatar
  • 5,790
73votes
8answers
90kviews

Axios: chaining multiple API requests

I need to chain a few API requests from the Google Maps API, and I'm trying to do it with Axios. Here is the first request, which is in componentWillMount() axios.get('https://maps.googleapis.com/...
user avatar
  • 1,099
58votes
2answers
162kviews

Using Axios GET with Authorization Header in React-Native App

I'm trying to use axios for a GET request with an API which requires an Authorization header. My current code: const AuthStr = 'Bearer ' + USER_TOKEN; where USER_TOKEN is the access token needed. ...
user avatar
  • 2,033
35votes
13answers
24kviews

Calling locally hosted server from Expo App

I am creating a react-native app and one of the components I have created contains a property which is populated through data coming from an http request. Right now I am hosting the server from my ...
user avatar
  • 663
31votes
12answers
74kviews

Axios (in React-native) not calling server in localhost

I'm building a really easy api and react-native application. The server works well (tested with PostMan) but the application doesn't call the server. It blocks when axios has to send the post request ...
user avatar
  • 1,890
20votes
9answers
80kviews

Network error with axios and react native

I have created an API endpoint using the Django python framework that I host externally. I can access my endpoint from a browser (mydomain.com/endpoint/) and verify that there is no error. The same is ...
user avatar
  • 4,503
12votes
2answers
19kviews

Network error with axios and android emulator

I got a React-Native application working with a NodeJS backend which serves an API. My React-Native front is using Expo and Axios to hit on a route of my NodeJS API (using Hapi, Joi, Knex), which ...
user avatar
  • 1,944
12votes
0answers
2kviews

React Native and Https Agent

Is possible use HTTPS Agent in React Native app? My code right now is: import axios from 'axios'; import ip from './ip'; import https from 'https'; const httpsAgent = new https.Agent({...
user avatar
11votes
12answers
12kviews

request formData to API, gets “Network Error” in axios while uploading image

I am making a POST request to server to upload an image and sending formdata using axios in react-native. i am getting "Network Error". i also try fetch but nothing work.using react native image ...
user avatar
11votes
3answers
22kviews

Network Error when use axios in React Native

This is long-standing problem for me and I can't find solution at all. Within my react native project(react-native-cli), I send request to server using axios package. But when I'm testing with my ...
user avatar
10votes
2answers
23kviews

react native post form data with object and file in it using axios

so i want to upload object as data and file as Note to api using axios uploadToServer= () => { const file =this.state.photo let data2 ={sale_id:1, note_type_id:4, ...
user avatar
10votes
2answers
13kviews

Axios is caching somehow my get user request react native

I'm using Axios ("axios": "^0.19.0") to do a GET request to my backend which works as I already tested it by sending the same token through Postman macOS app, and returns the correct user object. ...
user avatar
  • 2,729
9votes
3answers
6kviews

Create Axios instance with taking token from AsyncStorage

In my React Native App, I want to create an Axios instance to send headers to the backend with a token taken from AsyncStorage. However, the following Token() always returns an object( Promise ) ...
user avatar
  • 1,903
9votes
2answers
9kviews

Axios Promise Handling - Getting "Possible Unhandled Promise Rejection - TypeError: Network request failed" in react-native

In my react-native application on the login screen I'm working on providing the user with nice error messaging after entering in the incorrect username / password combination. To interact with the API ...
user avatar
  • 554
9votes
1answer
5kviews

Axios error Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream

I'm getting this error when trying to do a POST request using axios: Error: Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream at createError Here's my request: async ...
user avatar

15 30 50 per page
1
2 3 4 5
81