0wain / alpinejs-requests

✉️ Inline HTTP requests made simple for Alpine.js 🌲
9 stars 1 forks source link

GET requests using the magic method are sent as POST requests #1

Closed colincameron closed 2 months ago

colincameron commented 2 months ago

The method parameter was missing from the magic method definition, so it was defaulting to POST.

Adding the method parameter allows GET requests to be sent correctly.

Example:

<input type="text" x-model="email" x-on:keyup.debounce="$get('/api/check-email?email=' + email);" @get="emailFound = $event.detail.response.json()" required />
0wain commented 2 months ago

Hey!

Thanks for taking the time to submit a PR for this!

colincameron commented 2 months ago

No problem, thanks for merging. Can you push 1.0.4 to npm?

0wain commented 2 months ago

Published!