Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
255 votes
4 answers
450k views

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 (...
Sinan Samet's user avatar
  • 6,682
86 votes
8 answers
137k views

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/...
Freddy's user avatar
  • 1,229
68 votes
2 answers
215k views

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. ...
Ally Haire's user avatar
  • 2,498
50 votes
17 answers
47k views

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 ...
iSeeJay's user avatar
  • 823
42 votes
17 answers
184k views

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 ...
smilebomb's user avatar
  • 5,393
40 votes
13 answers
109k views

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 ...
Pibo's user avatar
  • 2,461
18 votes
7 answers
50k views

How to integrate AbortController with Axios and React?

The Abortcontroller signal is not working for me with Axios in React. I wanted to replace CancelToken (as it's deprecated) with the AbortController, but it is not working, respectively the requests ...
bbrinck's user avatar
  • 1,073
18 votes
8 answers
49k views

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 ...
Andrew Terex's user avatar
18 votes
2 answers
18k views

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 ...
Chan Jing Hong's user avatar
17 votes
19 answers
32k views

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 ...
Govind Maheshwari's user avatar
17 votes
5 answers
52k views

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, ...
Firas Abu Fares's user avatar
17 votes
2 answers
65k views

Check Axios request url before sending

API requests are failing because the URL generated by Axios is incorrect due to my config. I know what the request url is suppose to look like, so I want to see the request url Axios generates. I can ...
Dan's user avatar
  • 2,575
17 votes
1 answer
8k views

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({...
Mateus Alves de Oliveira's user avatar
16 votes
1 answer
22k views

Prevent axios/fetch redirection

I have a little problem with my app: I have to get some cookies given in the response of one URL, which is obtained by making a request to another URL. The request is done, but I'm not able to get the ...
Alexandre Michaud's user avatar
13 votes
3 answers
10k views

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 ) ...
Pavindu's user avatar
  • 2,974
13 votes
2 answers
24k views

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 ...
GuillaumeRZ's user avatar
  • 2,816
12 votes
2 answers
20k views

Mock Postman request into Axios?

I'm trying to construct my axios to be able to mimic the postman request but failed. Please help to have a look const ax = axios.create({ timeout: 30000, headers: { 'content-type': '...
Isaac's user avatar
  • 12.7k
11 votes
2 answers
16k views

Header keys become lowercase when interacting with API - React native

When interacting with API, the custom Header key always become lowercase. I'm use Fetch, Axios, XMLHttpRequest and Frisbee (javascript network library) but the key always lowercase My snippet code ...
bkit4u's user avatar
  • 535
11 votes
0 answers
2k views

Disable axios redirects in react-native

I'm currently developing an react-native app that authenticates using a server that returns an 302, and a location redirect in the response header. But I need an variable that inside the location ...
SilentLucidity's user avatar
10 votes
3 answers
19k views

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. ...
msqar's user avatar
  • 2,990
10 votes
1 answer
9k views

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 ...
Zach Cook's user avatar
  • 614
10 votes
1 answer
1k views

Axios returns only last "set-cookie" if there are multiple

I'm using axios in my react-native app to call rest api. in response to api call, server returns multiple 'set-cookie' headers. But axios returns only the last one. Tried the same API in Postman, ...
Raheel's user avatar
  • 431
10 votes
0 answers
5k views

How to ignore SSL issues in axios using React Native?

Hi I'm currently working with react native on Android with Expo. I am trying to send requests to my server which has a valid ssl certificate, but for some reason axios takes it as invalid, so axios ...
Alexandros's user avatar
9 votes
2 answers
11k views

How to use react-redux to store a token and use it on multiple axios request?

I am building an app using react native that requires me to do multiple get request on same API with token. Let say the URL is like this: Token URL = https://test.co/v1/tokens, API URL 1 = https://...
Fang's user avatar
  • 834
9 votes
2 answers
3k views

React Native Axios get response Skipped and Status Code 0

I got a problem with my react native app. while accessing API, I get a response Skipped and status code 0. it's shown by using reactotron to log the api response, but when I console.log the error, it ...
Adam Davarel Nostradatito's user avatar
9 votes
1 answer
10k views

Handling Refresh Token in React Native

I have an app authenticating fine and returning the access_token and refresh_token. I store them with AsyncStorage and save/get the access_token with redux. This is the very first app I am building ...
Jeff's user avatar
  • 543
9 votes
0 answers
2k views

React native IOS :axios/fetch request stuck with no error or no response on IOS only

Description: sending a request with Axios or fetch in IOS not work and it doesn't matter if the API is HTTPS or HTTP no error reaches the catch or no response received also no errors, only warnings ...
Mohammed naji's user avatar
8 votes
3 answers
14k views

Call localhost API within react native ( android device : connected through local)

Have created a simple GET API using node.js and trying to consume it within my expo-react native project using axios/fetch. The GET API is called whenever user clicks on submit button. Submit -> ...
user9571141's user avatar
8 votes
1 answer
6k views

React Native Axios allow self signed ssl certificate

I'm writing an app in React Native, and I need to make API requests. The server for that is running on a server with a self-signed SSL certificate, so I need Axios and React Native to make the request ...
b3nj4m1n's user avatar
  • 524
8 votes
1 answer
2k views

Require cycle while requiring store in axios

In a reactive native application which is using a redux-saga architecture plus axios, I want to intercept 401 requests and dispatch an action which sends me to a login screen. So in my axios client, ...
superandrew's user avatar
  • 1,751
8 votes
1 answer
2k views

Axios image upload using post form data always returns network error

Having problem uploading an image on android running react native using axios. I have researched a lot about this and have tried a lot of things for the past 3days but no solution yet. This seem to ...
Vamsi Calpakkam's user avatar
7 votes
6 answers
25k views

React Native - Axios - Trying to upload image

I am new to React Native and trying to upload Image with Axios but getting: Request failed with status code 500 I don't have backend problem because I can upload image with postman and everything is ...
laja's user avatar
  • 143
7 votes
1 answer
28k views

Possible Unhandled Promise Rejection Network Error in React Native

I setup my local server using express.js, That simply handle request and return simple message. app.get('/hello', (req, res) => { res.send('Hello world !'); }); I executed server and test it ...
ton1's user avatar
  • 7,558
7 votes
3 answers
16k views

How to Check if Axios Call Fails due to No Internet Connection?

I'm trying to figure out an accurate way to detect axios call failure due to no internet connection. Does axios call failure return a specific response object or specific response status code or ...
kaizen's user avatar
  • 1,620
7 votes
5 answers
14k views

React Native Axios request on iOS returns "Network Error"

I created a RN project (without Expo) and setup my API services. I'm using dummyapi.io to get dummy post data, which is a HTTPS request. I keep getting "Network Error" from Axios and when I ...
Ece Mac's user avatar
  • 131
7 votes
1 answer
39k views

Get API data with POST method in react-native with axios

I need to get data in react-native app with axios. I can get data with simple GET method as below: class AlbumList extends Component { state = { albums: [] }; componentWillMount() { //axios.get(...
Jarnail S's user avatar
  • 391
7 votes
2 answers
20k views

Detect and handle slow internet connection in React-Native

Currently I am using NetInfo of react-native and with the help of EffectiveConnectionType, I am able to find the connection is in : 2g, 3g, 4g and unknown. But is there any optimise way to handle this ...
yogeshwar nair's user avatar
7 votes
1 answer
4k views

Image Upload with React Native, Expo ImagePicker, Rails, Axios and Paperclip

So far everything works in the backend regarding Rails and Paperclip. I have it set up so that when you create a new Post, the image within that post will be uploaded to AWS S3. It works fine on the ...
Jimmy Li's user avatar
  • 141
7 votes
5 answers
38k views

Possible unhandled promise rejection, network error when using axios

I'm trying to send JSON data using react-native, axios and Expo, but when I press "Send" on my application, I get this warning: Possible unhandled promise rejection, Error: Network Error My API ...
Biel Borba's user avatar
7 votes
1 answer
9k views

How do you pass body data with an Amplify REST request?

I'm using the AWS amplify REST API to make a get request to my lambda function in React Native. The API/Lambda function was generated by the Amplify CLI. const getData = async (loca) => { ...
ProEvilz's user avatar
  • 5,415
7 votes
3 answers
10k views

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found in React-Native [duplicate]

I am building an app in react-native and using axios package for post request. I get the error when axios post request in react-native android app. SSL certificate is signed with letsencrypt. Https ...
zainhassan's user avatar
  • 1,720
7 votes
3 answers
83k views

axios get request return request failed with error 400

I need help on solving this issue. I am new with react native and javascript. Now I am trying to hook up the react native application with API. This process require me to get the token first by axios....
Ling's user avatar
  • 901
7 votes
0 answers
1k views

how to disable SSL in react native expo in fetch or axios API call

I am trying to disable SSL in react native expo here is what I have tried import * as https from "https" const agent = new https.Agent({ rejectUnauthorized: false, }); let response = ...
user avatar
7 votes
1 answer
13k views

https undefined in react native axios

I have used axios for react native app but while implementing https.agent it shows https is undefined. How to solve this? My code const instance = axios.create({ httpsAgent: new https.Agent({ ...
Drench's user avatar
  • 141
6 votes
1 answer
4k views

Axios interceptors - Not using instance until AsyncStorage resolved?

I've an Axios Interceptor setup to manage responses and cut down on re-writing code everywhere. Currently, I need to add the Authorization header using the { config } object in each call like below. ...
denden's user avatar
  • 1,319
6 votes
2 answers
15k views

Axios post request with header not working

I have used axios for calling network request in react-Native but it return 500 response code. Note: It's working perfect in postman client. Authorization Token: Bearer ...
Kishore Jethava's user avatar
6 votes
4 answers
7k views

React Native + Expo + Axios file upload not working because axios is not sending the form data to the server

I am trying to upload an image with react native front end and axios to my back end. This is how pic the image const pickImage = async () => { let result = await ImagePicker....
Lonare's user avatar
  • 4,437
6 votes
3 answers
8k views

Android issue uploading image to server using Axios in React-Native App

I am getting the following network error when attempting to upload/POST an image from Android. Works perfectly on iOS. Works perfectly on Android when no image included in FormData. export function ...
bob friston's user avatar
6 votes
2 answers
14k views

Axios POST request sending nothing with 'multipart/form-data' [React Native - Expo]

Scenario Front end is basically a React Native (Expo) application where users can issue a report - this includes taking multiple photos and filling in some details. Backend is just node.js, with ...
Jayjay Choo's user avatar
6 votes
1 answer
4k views

How to display a "content-type: image/jpg" response from the API? (React Native) [duplicate]

I'm posting an image, and getting the processed image as a response from the backend. The problem is with the response part. I can't display the image whatever I do. First of all, Postman works. So ...
Aras Uludağ's user avatar

1
2 3 4 5
31