Questions tagged [axios]

Axios is a Promise-based HTTP client for JavaScript which can be used in your front-end application and in your Node.js backend.

Promise based HTTP client for the browser and Node.js, available on Github.

Features

  • Make XMLHttpRequest from the browser
  • Make HTTP requests from Node.js
  • Supports the Promise API
  • Intercept request and response
  • Transform request and response data
  • Automatic transforms for JSON data
  • Client side support for protecting against XSRF

Installation

Using npm:

npm install axios

Using bower:

bower install axios

Using yarn:

yarn add axios

Using jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

Using unpkg CDN:

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
24271 questions
4
votes
2 answers

Vue or Axios don't store session cookie

I face a problem but i don't know where it be and why. I have a backend API based on express4(nodejs) We have implemented Auth with passport. When i use postman, i log with post on /login. it store a session cookie and all route is now accesible…
arckosfr
  • 59
  • 1
  • 1
  • 5
4
votes
2 answers

Vue JS AJAX computed property

Ok, I believe I am VERY close to having my first working Vue JS application but I keep hitting little snag after little snag. I hope this is the last little snag. I am using vue-async-computed and axios to fetch a customer object from my API. I am…
Ampix0
  • 135
  • 1
  • 3
  • 11
4
votes
2 answers

Passing an object with a parameter with multiple values as a query string in a GET using axios

It is common to pass a parameter with multiple values as a query string on a GET: http://server/status?stat=a&stat=b How does one create this type of query string using the axios library in JS? Creating an object where the parameter name is the key…
flashmatrix
  • 185
  • 1
  • 2
  • 6
4
votes
1 answer

Axios - Sending Nested JSON Object

I have a web page that is using the Axios Http Client. In my web page, I'm getting my location using the browser's geolocation feature. When my location is obtained, I want to send that location, along with other data. To do this, I've built data…
Some User
  • 5,257
  • 13
  • 51
  • 93
4
votes
2 answers

Performing multiple requests Axios (Vue.js)

I am trying to perform two, non-concurrent request, but would like to use data from my first request before performing a second request. How can I achieve getting the data from the first request then using that data for the second request?…
A_A
  • 310
  • 4
  • 13
4
votes
1 answer

Different return types based on optional function parameter - Typescript

I have a function that is a wrapper for axios.request. I send a Message type along with config so that I can create a new Message with the response.data. I have multiple types of Messages, so I am creating a generic TMessage type to handle…
T Mitchell
  • 1,017
  • 7
  • 12
4
votes
1 answer

Firebase OAuth login & data access with axios

I am pretty new to Axios and very new to OAuth and Firebase, so I'm sure I'm missing something dumb... I am trying to create a sign in using firebase's auth provider functions & then create a user profile in my database using Axios. (I have to make…
4
votes
0 answers

How to iterate over unknown-size result set via callback function?

Apologies if the title is a little obtuse, this is a hard one to condense into a single sentence. I'm using axios to request a resultset from an HTTP endpoint. This endpoint can only deliver 50 records at a time, but will have an unknown total…
rjcoupe
  • 123
  • 5
4
votes
2 answers

Axios API call returning Promise object instead of result?

Before I start, let me say that I'm new to Javascript and very new to axios API calls, so I'm probably making a rookie mistake... I have this function getObjects() that's meant to map over an array and return the data from an Axios API call. The API…
JSilv
  • 1,035
  • 12
  • 26
4
votes
3 answers

Weather API request cors error

I am trying to get weather data from dark sky api and I keep getting a cors error. Here is my code: var url = `https://api.darksky.net/forecast/febb2871126cd24613f32a79c32d4158/${lat},${lon}`; axios.get(url, config).then(response => { …
itsame-ebp
  • 63
  • 1
  • 1
  • 4
4
votes
1 answer

Characters broken in React Native with Arabic and Persian Language on Android axios (XMLHttpRequest)

Is there anyone has this problem? With Arabic and Persian language, I am using axios. And axios using XmlHttpRequest on react-native. There is no problem with iphone. But on android, The characters are broken. Not only those Arabic or Persian…
Dongmin Kim
  • 83
  • 1
  • 5
4
votes
1 answer

CORS issue using axios with Slack API

I am using axios, from browser, to interface with Slack webhook API. When sending a post, I try to use axios.post(url, data) Browser/axios sends an OPTION request to the backend. Included in the OPTION request is…
Overclocked
  • 1,187
  • 1
  • 11
  • 22
4
votes
3 answers

how to pass consumer key and consumer secret parameters in axios based network calls?

I want to get data from backend using woocommerce api, but for that I need to pass Consumer Key and Consumer Secret, I am using axios library, so how can I pass those parameters with them? the parameters that i want to include are : The code that I…
Mrugesh
  • 4,381
  • 8
  • 42
  • 84
4
votes
1 answer

Using Lodash's Debounce on Axios Request Produces Unexpected Result

My app updates every time text is typed. Then using debounce on an axios request, the requests are queued up until the timer runs out, and then they all go at once. I am trying to limit the requests to one per 10 second period. Where am I going…
Slbox
  • 10,957
  • 15
  • 54
  • 106
4
votes
0 answers

IPV6 API call with NodeJS on Ubuntu

I'm trying to figure out how to make an API call to my Ubuntu/NodeJS server that is running on DigitalOcean using an IPV6 address. With an IPV4 address, the API call looks like…
Mike Gee
  • 85
  • 7
1 2 3
99
100