Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
¿Cómo paso un encabezado de axios antes de acceder a un controlador?

¿Hay alguna forma de inyectar el encabezado axios.get() en una solicitud de ruta antes de acceder al controlador?

Tenga en cuenta que se envió un enlace con la URL (/ verificar) al correo electrónico de los usuarios a través de API y quiero incluir el token del portador y luego el usuario hace clic en la URL.

Esta es mi ruta desde web.php

 Route::get('/verify-email', [VerifyEmailController::class, '__invoke']) ->middleware(['signed', 'throttle:6,1']) ->name('verification.verify');

Y esto es crear en una carpeta js

 import axios from 'axios' axios.create({ baseURL: '/verify-email', headers: {'Bearer Token': 'foobar515615612655'} });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe agregar el encabezado x-requested-with con XMLHttpRequest como valor.

Mira el siguiente ejemplo:

 headers: { 'Bearer Token': 'foobar515615612655', 'x-requested-with' : 'XMLHttpRequest' }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!