export const axios = axiosLib.create({ paramsSerializer: params => qs.stringify(params), @@ -14,6 +15,11 @@ axios.interceptors.request.use(config => { const apiKey = Auth.getApiKey(); if (apiKey) { config.headers.Authorization = `Key ${apiKey}`; } else { const csrfToken = Co...
I performed axios post operations within the grecaptcha.execute expression. Previously, I couldn't send the token value received from Google to the backend in any way. Matthew Peavoy 1 year ago For anyone stuck, there's a couple of lines missing from this tutorial (they are in the video...
* CSRF token as a header based on the value of the "XSRF" token cookie. */ window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /** * Echo exposes an expressive API for subscribing to channels and listening * for events that...
<!-- 网站icon,来自于Google开源图标 --> @yield('title') - {{ config('app.name', 'Wizard API') }}
reject("Failed to obtain the cookie."); } return axios(path, { headers: { referer: referer, "content-type": "application/json", cookie, ...(settings && settings.headers), }, xsrfCookieName: "csrftoken", xsrfHeaderName: "X-CSRFToken", ...(settings && omit(settings, "headers")), ...
reject("Failed to obtain the cookie."); } return axios(path, { headers: { referer: referer, "content-type": "application/json", cookie, ...(settings && settings.headers), }, xsrfCookieName: "csrftoken", xsrfHeaderName: "X-CSRFToken", ...(settings && omit(settings, "headers")), ...
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; } else { console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); } /** /** * Echo exposes an expressive API for subscribing to cha...