#can i do get requests with server actions?

3 messages · Page 1 of 1 (latest)

cursive tapir
#

can i do get requests with server actions?

dusty obsidianBOT
#

Hi @cursive tapir. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

No, you cannot use GET requests with server actions in Astro. According to the Astro documentation, only POST requests are supported for server actions. If you try to call an action from a form using a GET request, you will encounter an ActionsUsedWithForGetError. This often occurs if method="POST" is missing on the form.

For more information, you can refer to the Astro documentation on this error (https://docs.astro.build/en/reference/errors/actions-used-with-for-get-error/#_top).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: