-1

i am doing a GET request using axios on laravel api request is going sucessfull but i am getting empty response here is the code when i change the base url of axio

window.axios = require('axios');
window.ajaxHeaders = {
    'X-CSRF-TOKEN': window.Laravel.csrfToken,
    'X-Requested-With': 'XMLHttpRequest'
};
window.axios.defaults.headers.common = window.ajaxHeaders
window.axios.defaults.baseURL="https://roqstaraudio.com/";

this is request enter image description here

this is empty response enter image description here and when hitting the same url on browser getting data enter image description here

and this the url i am calling from ajax by GET Request

https://roqstaraudio.com/api/item/list?categories[0]=2&order[0]=latest&per_page=18&relations[0]=creator

getting this in console enter image description here

Shahneel Ahmed
  • 163
  • 3
  • 18

1 Answers1

0

That was an OPTIONS request, not a GET one. Check your console for more info

enapupe
  • 15,691
  • 3
  • 29
  • 45