#posting data to an external API from a FORM

9 messages · Page 1 of 1 (latest)

vagrant coyote
#

Hello! I need some help with forms in astro I'm starting with the framework and I'm a little confused about the forms and sending info to an external API, I've been following the steps in the documentation but I'm getting console errors, can please some one guide me? I'm not using an adapter because I don't need the backend inside astro code 😦

upper fiber
#

What console errors are you getting?

vagrant coyote
upper fiber
#

Need to look at the documentation for that API and see whats its expecting

rose kindle
#

Is this happening in production or development?

vagrant coyote
#

In development

#

could it be because the formdata? I need to send that data

flint pike
# vagrant coyote

Hello @vagrant coyote, the HTTP error 415 indicates "Unsupported Media Type." It occurs when the server cannot process the media type provided in the request, such as an unsupported or missing Content-Type header. Did you try setting the headers to application/x-www-form-urlencoded ?

rose kindle