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

ASP.NET MVC core POST Request not converting JSON data to Model

I have a model that I serialize to the screen and use with Vue.js. After screen/model changes I am using axios to perform a POST request back into my ASP.NET Core (2.0) Controller. So far every combination of tries results in all null values when…
Adam
  • 490
  • 7
  • 21
4
votes
1 answer

VueJs local assets path

I'm working on a Vuejs App. based on Quasar Framework , in src/components/Hello.vue there i have a function to load json file axios.get('../assets/json/ar/myfile.json') .then(response => { // JSON responses are automatically parsed. …
rashidnk
  • 4,096
  • 2
  • 22
  • 32
4
votes
2 answers

React - Controlling multiple Ajax Calls

In my react application, I have a Grid. User can select many grid rows at a time and click on a button to take bulk action on selected grid rows. On a server side I have a script which I want to execute for each selected row (to make question simple…
ThinkGeek
  • 4,749
  • 13
  • 44
  • 91
4
votes
2 answers

Reducer returns undefined when using redux-promise and axios

I'm having this issue when I'm trying to invoke a callback after the promise resolves (using .then) It turns out that this gives my const request some kind of different promise that reducer returns as undefined: action: export function…
4
votes
0 answers

Can't set headers after they are sent...no issue until I added in authentication?

I'm having some issues trying to send an axios requests with custom headers from my app so I can use them for authentication on my server. I have a react native app that uses firebase authentication and a node/express backend server. When a user…
judgejab
  • 519
  • 1
  • 3
  • 14
4
votes
1 answer

How to consume own api with Laravel Passport and client credentials?

I have correctly set it up for users with personal access tokens, but would like to protect ALL api routes. Reading the documentation it sounds like Client Credentials Grant Tokens is what I need. I have a Client ID and Client Secret in my .env…
user7856768
4
votes
2 answers

Cannot make POST request with JSON from react/axios to restify server

I have a restify set up like this: var restify = require('restify'); const server = restify.createServer(); //server.use(restify.plugins.acceptParser(server.acceptable)); //…
Christian
  • 3,239
  • 5
  • 38
  • 79
4
votes
2 answers

Axios POST request passing all params as one body key

I have a simple Axios POST request: const data = JSON.stringify({ to: receiver, from: sender, body: message }); axios.post(window.location.origin + '/sms/outgoing', data) My issue is that my api reads the request body as this: {…
achalk
  • 3,229
  • 3
  • 17
  • 37
4
votes
2 answers

How to return boolean with axios

In VueJS I am trying to return a boolean with axios allContactsSaved() { let promise = axios.get('/contacts'); console.log(promise.then(function (response) { response.data.data.forEach(function(contact) { if…
Mango D
  • 501
  • 3
  • 11
  • 28
4
votes
1 answer

Axios: Send null value as param in request

Is there a possibility to pass a parameter with the value of null to axios? It seems that null values are just ignored...
F.M.F.
  • 1,929
  • 3
  • 23
  • 42
4
votes
2 answers

How to make direct api call to cloudinary with axios?

I am trying to figure this out with axios. I have made the direct api call with superagent and now want to know how to use with axios as the rest of my project is with axios. I know there is cloudinary-react, but this is the way I prefer to do…
user7366497
4
votes
1 answer

accessing response header via Axios

I'm using Axios to make a secure POST call to an API. This returns an URL within the response headers under 'Location'. I can see the URL being populated within Chrome's dev tools: but the response inside JS from Axios (below) doesn't contain this…
Rich
  • 970
  • 2
  • 16
  • 42
4
votes
2 answers

Axios: Upload progress for multiple file uploads

Following https://github.com/mzabriskie/axios/blob/master/examples/upload/index.html I've set up a file upload with progress bar. However, I have , so the upload is inside a loop like this: for (var i=0; i
Thomas Landauer
  • 7,857
  • 10
  • 47
  • 99
4
votes
3 answers

Uploading files with VueJS, axios and Laravel

Hello I am building one project. Where user can send up to 5 images and up to 10 songs with the text. But when I send request to the server, where I handle with Laravel, I can't get those files. // my data object from VueJS data() { return { …
Azat Akmyradov
  • 176
  • 2
  • 2
  • 10
4
votes
0 answers

vue + mailchimp ajax signup cors error

using axios in a vue.js project, I'm having issues call the mailchimp API to sign up an email for a newsletter. axios.post('//myappname.us9.list-manage.com/subscribe/post-json', { u: 'abcde', id: '12345', EMAIL:…
Qar
  • 1,746
  • 3
  • 17
  • 24