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

220
Views
set Bearer Token in <form action>

I have a vanilla HTML/Js page which submit to a Laravel API (Auth with Sanctum).

So if i call a Laravel Api route via ajax call i can easily set the Bearer token in the header for authentication like:

axios.get(data_source_url + "/articles", {
        headers: {
            Authorization: 'Bearer '+ token,
            Accept : "application/json; charset=utf-8"
        }
}).then...

But if i wanna submit my HTML formular via:

<form method="POST" action="https://myApi">
...
    <button type=submit>
</form>

i have no idea how to set Header attributes/information. Is it even possible to set a Header on a <form action>?

I know i could call a function with a <button type=button onclick="sendData"> but thats not my question.

about 4 years ago · Juan Pablo Isaza
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!