Most voted "axios" questions
AXIOS is a library used for AJAX requests based on files. Use this tag when the problem refers to library usage.
Learn more…196 questions
Sort by count of
-
5
votes1
answer375
viewsHow to cancel/interrupt a request made with Axios?
Generally, I usually make some AJAX calls with the library Axios. Those days I needed a resource, where I could interrupt a certain request already started, but did not know how to do. Is there any…
-
4
votes1
answer4066
viewsjwt authentication with vuejs
I’m a little confused with the authentication using jwt token, I have an application in vuejs + Vue-router, I don’t want to use vuex until I learn to do it without it (I don’t like to use what I…
-
4
votes4
answers29846
viewsRequest with Axios and React blocked by CORS policy
I’m trying to request an API using Axios: axios.post('http://api.teste.com.br/v1/getToken', { withCredentials: true, auth: { username: 'usuario', password: 'password' }, headers: {…
-
4
votes2
answers2885
viewsRetry Case Gives Timeout with Axios
Eae guys, I have a little problem to give a Retry in a POST using Next case exceeds Timeout. I’m trying to implement this(https://github.com/softonic/axios-retry) library next to Axios, but it…
-
4
votes1
answer12477
viewsUpload image with Axios to a Node.JS server
I’m trying to upload an image using the library Axios, but she’s not getting into the back-end. Image input <input type="file" class="custom-file-input" id="file" name="file"> Note: My form…
-
4
votes1
answer90
viewsHow can I filter two values in my object array?
Hello! I’m having trouble understanding how I can filter the answer I get from my database, its logic is like this: I receive an array of objects from which it has the values of use, useridRequerent…
-
3
votes1
answer2649
viewsDoing a Get using Axios (Vue.js)
I’m trying to pull up a list of names coming from a json (http://pokeapi.co/api/v2/pokemon) using the Xios but I don’t understand why I get the error Typeerror: Cannot set Property 'Pokemons' of…
-
3
votes1
answer2560
viewsHow to make several requests in parallel in Xios?
I have two urls to request: https://api.tuuris/cities and https://api.tuuris/expenses I would like to request both in parallel, currently I have done separately as in the code below: axios…
-
3
votes1
answer625
viewsTaking data from Xios and vuejs
I have a very strange problem, I have the following code inside a component of Vuejs. I am developing a system where I choose the options through several checkboxes, and pass their id to that my…
-
3
votes1
answer439
viewsHow to post in XML in Reacjs
I am starting my walk in Reactjs, and I am going through a problem a few days ago, which is to login to an external api in my application, to give the user access to the rest of the application. I…
-
3
votes1
answer68
viewsCreate a <div> inside a . catch in Aces
Hello, I am currently developing in React and am trying to put a div inside the .catch. I am currently using the following code: componentDidMount() { axios.get(API_ListaEmpresa) .then(response…
-
3
votes2
answers928
viewsHow to hide Axios request data in Javascript (JS Node)
Hello, I’m developing an application and setting up a user registration screen, but I’m wondering if it’s possible to hide the data that Axios is requesting for the API. My Javascript code, which I…
-
2
votes1
answer1395
viewsHow to send application files to the API
I have an APP in React-Native and an API with Laravel Both are communicating correctly, sending APP data to the API and otherwise correctly Currently to send and receive requests in the APP I use…
-
2
votes1
answer1335
viewsError: Cannot read Property 'Protocol' of Undefined
Template: <input type="text" v-model.trim="enterURL" placeholder="Enter URL here" @keyup.enter="Entered"> <v-btn icon @click.native.stop="Entered"> <v-icon>send</v-icon>…
-
2
votes1
answer10860
viewsHow to use async / await in get request using Vue+Axios?
I have the following code and would like to know how I can implement a Try / catch with async / await running the same function: import Vue from 'vue' import axios from 'axios' new Vue({ el: '#app',…
-
2
votes1
answer452
viewsPromise not returning value
My request is returning this to me: data: Promise Opening Chrome Developer Tools I see this: data: Promise __proto__:Promise [[PromiseStatus]]:"resolved" [[PromiseValue]]:"24/01/2016" Using Axios,…
-
2
votes1
answer3854
viewsXios basic auth - how to pass user and password to the api?
I was looking at the documentation of Xios and saw that to pass the user and password it is necessary to use: auth: { username: 'janedoe', password: 's00pers3cret' }, I applied the same to my…
-
2
votes2
answers407
viewsHow to fire a Redux Action without a React
Hi, I’m creating a Interceptor to the Xios which, if my Answer case there is an error with the status Forbidden (403) the same need to trigger the Action that starts the user’s logoff to force him…
-
2
votes2
answers3730
viewsCORS: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status
I can get the TOKEN of my application by using Postman as follows. This works perfectly, and return me the Token. However when I try to make the same request, using Axios, in my application with…
-
2
votes1
answer11168
viewsAxios get giving network error
I’m taking a course of React Active, but since my computer didn’t run Genymotion, I had to improvise and downloaded Bluestacks to debug the projects. The problem is that when my program requests…
-
2
votes1
answer287
viewsAccess a list within a list in React jsx
Hello, I’m a newcomer to React and am making a request via Xios. This request returns me the following JSON: after receiving this list I make a .map on the list and it returns me the following: What…
-
2
votes1
answer204
viewsWhy are arrays inside an object Undefined in the request of the api using Xios?
I created an api that sends this information: { title: 'algum título', content: ['vários parágrafos'] } The method that receives the data is as follows: async componentDidMount() { let response =…
-
2
votes2
answers417
viewsAxios falls in catch even with status code 200
I have a login code, that when a user logs in if the data is incorrect a backend done in nodejs returns an error 401 and if everything is correct returns a status code of 200. During the execution…
-
2
votes1
answer919
viewsProblem with CORS using Vue + Laravel (only GET method works)
Vue: CLI 3 Laravel: 6 When trying to use different GET requests (e.g.: POST, DELETE), I get the following message: Access to Xmlhttprequest at 'http://127.0.0.1:8000/api/test' from origin…
-
2
votes1
answer194
viewsI am unable to extract data from json - React-js
gentlemen(as). I am unable to extract a data to send to api. in the /cases path the api provides json data. useEffect(()=> { api.get('cases',{ }).then(response =>{ setcases(response.data) })…
-
2
votes1
answer675
viewsHow to capture Axios error Response data when user has no connection?
I am using the Third Party of axios to handle errors in requests. I am currently using this way: const api = axios.create({ baseURL: 'http://localhost:3333' }); api.interceptors.response.use(…
-
2
votes1
answer155
viewsAxios: stop in GET does not work - React Native
I have a database in Mongo with customers and establishments. I want to recover the establishments filtered by category. My code is like this: const [datas, setDatas] = useState([]) //recupera os…
-
1
votes1
answer938
viewsHow to update properties in React "setState"
I’m trying to add objects to 2 properties of the Fecthapis component. I make the call to both Api’s, and I get the request with the expected objects. However, when I try to include these objects in…
-
1
votes1
answer1610
viewsDownload PDF Files in Reactjs
I have a small problem in downloading PDF files I have a API that returns a array bytes with the type: "application/pdf", if I call straight in my browser route. Ex: localhost/api/download/pdf/{id}…
-
1
votes2
answers2120
viewsAPI works in POSTMAN, but not in code
I am trying to access an API, by Postman, it works and returns json normally, already by code (using Vuejs + Axios) does not return, from CROSS error, how can this? where Axios returns normally? let…
-
1
votes1
answer6638
viewsDownload using the Xios?
I am using Axios to perform my application requests, and in one of the GET requests it returns a PDF file. When I do the GET request by Postman it opens a window to choose where to save the file,…
-
1
votes2
answers99
viewsDoubt REST - POST
I wonder if it is possible after the resolution of the Promise of a POST if I can get the result and turn into an array Ex: axios.post(http://localhost:5000/api/horario/,{ Nome: nome, Horario:…
-
1
votes0
answers106
viewsProblems with Vue in an Laravel project
This is my project. http://laravel-vue-axios.herokuapp.com/ He is able to save, delete and edit, but when I do the actions I cannot perform the automatic refresh in the browser, I don’t even know…
-
1
votes0
answers584
viewsDoubt how to recover data using Next Act-Native
Fala galera, I’m still starting in React-On and I’m doing a test by connecting to a webservice: consultar(){ var ret = ''; ret =…
-
1
votes2
answers273
viewsError making API requests using Axios and Vue-Resource
It was consuming data from an API using XHR and was working very well, but there were some changes to the project and the need to use Vue arose. I tried to make the same requests using Axios and…
-
1
votes1
answer450
viewsCompeting requests using Xios without losing the session
I am developing a Crawler using Xios. How can I make multiple requests or callbacks without losing the session and without having to manipulate cookies? Note the example below. When logging in, I…
-
1
votes1
answer3336
viewsVuejs - Popular select with API data
I am having problems to popular a select with the data I have as return of an API. I am using Vue. Follows codes: My HTML is like this: <select> <option value="" disabled…
-
1
votes1
answer589
viewsPass parameters(including an image) to PHP with Axios using formData
I created an React component to be my custom input button: getFormData(){ var formData = new FormData(); var imagefile = document.querySelector('#btn_file_logo'); formData.append("image",…
-
1
votes1
answer1468
viewsHow to submit a post request using Xios and Asp.net Core Web API?
I’m making a requisition with axios with the verb post, but I’m not getting it. Note> With the verb get I can do the requisition. Object cliente: { nomeCompleto: '', cpf: '', email: '', endereco:…
-
1
votes1
answer579
viewsWhy use Redux to request the API in React?
I started to see React well before learning how to use Redux and always requested in the API using a Fetch or Axios in the component itself. Today I already venture into the world of Redux and come…
-
1
votes1
answer340
viewsI am trying to consume an api in js via get by Xios
I’m trying to consume an API on js via get by axios, API containing a parameter apikey, how the code should look? as I’m trying to do: axios.get('url', {params{apikey:'chave_api_key'}})…
-
1
votes0
answers26
viewsHow to create a service structure in vuejs using typescript and Generics?
Usually when I create a Vuejs + Typescript project I like to split the Services by creating methods that perform post requests, update, get and delete but I noticed that I was repeating a lot of…
-
1
votes0
answers296
viewsI can’t get access to Xios
I am using Axios by Cdn and error appears: "Uncaught Error: URL contains XSS Injection Attempt" The Javascript code of the main_axios.js file axios.get('https://api.github.com/users/diego3g')…
-
1
votes0
answers171
viewsError: read ECONNRESET and Error: connect ETIMEDOUT
Good night, you guys. I’m doing scraping (web scraping) from a website, I’m using the Nodejs and Xios. When I run the application it works perfectly bringing me the information I requested, but it…
-
1
votes1
answer95
viewsHow to access a given object within JSON via Axios
I want to get the data of product_id, product_name and product_price using Axios. { "status": "success", "url": { "https://api.exemplo.com/product-1": { "data": { "product_id": "1", "product_name":…
-
1
votes1
answer1299
viewsAxios GET Request Response is Undefined
I’m trying to make an Next call in my Node JS Express app and sending the data to my index.ejs file. The problem is that i can see the data in my callApijavascript file but i cant access the…
-
1
votes1
answer628
viewsReact Axios PUT/PATCH method Unauthorized, Laravel 5.7
The PUT/PATCH methods available in the API via the function Route::apiResource('user','UserController'); are those: GET and POST requests work normally, but in the PUT/PATCH route implementation I…
-
1
votes1
answer356
viewsI’m trying to print the result using Xios
I’m trying to understand how Xios works, but I’m stuck when it comes to printing the information on the screen. I can view the result through the browser console and a Undefined on top, but I don’t…
-
1
votes0
answers665
viewsPost post Submission with Axios
Hello, I’ve been bumping my head to solve a problem with sending a POST request from a SOAP envelope with Xios, I send the same XML with the same Reset by POSTMAN and it works pretty good, but when…
-
1
votes0
answers2042
viewsAxios get error - React Native
I’m taking a React Native course and I’m not able to make an HTTP request using Axios. This is my code: import React, { Component } from 'react' import { View } from 'react-native' import axios from…