The problem of adding request headers to axios

  1. backstage asked me to add a request header to determine whether it is an ajax request x-requested-with = XMLHttpRequest
  2. I have tested in postman that you can get the data

    clipboard.png

  3. axiosproxyTable


    main.js


clipboard.png

after adding the request header.

May.23,2021

set headers. directly using axios.create,


API<br>main.js

Axios.defaults.headers.common['key'] = 'value';

it is our background that restricts my request. The background needs to add a parameter that allows me to add the request header

("Access-Control-Allow-Headers","key");
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37929-2c0bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37929-2c0bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?