Closed imacrayon closed 7 months ago
Fixes #44
Use x-headers to set request headers, JavaScript expressions allowed:
x-headers
<form method="post" action="/articles" x-headers="{'X-CSRFToken': '{{ csrf_token }}'}">
Use the headers option to set request headers for $ajax magics:
headers
$ajax
<div @click="$ajax({ method: 'post', action: '/articles', headers: { 'X-CSRFToken': '{{ csrf_token }}'}, })">
This PR also adds an X-Alpine-Target header in every request which lists the IDs (space-separated) of all targets on the page:
X-Alpine-Target
<form method="post" action="/articles x-target="articles articles_count">
Issues a request with headers:
X-Alpine-Request: true X-Alpine-Target: articles articles_count
This could be used to generate HTML fragments on the server.
Amazing. Thanks for this update!
Fixes #44
Use
x-headers
to set request headers, JavaScript expressions allowed:Use the
headers
option to set request headers for$ajax
magics:This PR also adds an
X-Alpine-Target
header in every request which lists the IDs (space-separated) of all targets on the page:Issues a request with headers:
This could be used to generate HTML fragments on the server.