Cannot use other HTTP verbs than GET
Service ID: 477e340b-e1f6-4da7-8ae2-2eeb32de06ee
Hello, i'm having trouble using HTTP verbs other than the GET method when trying to access another endpoint than GET in my front-end or on postman, like the "/autenticar"
This error only occurs when I try to execute a method other than GET, such as the "/cidades" endpoint, a GET listing method, but if I call it again passing the POST verb, the response is as if I did in GET, even not having the "POST /cidades"
8 Replies
Project ID:
477e340b-e1f6-4da7-8ae2-2eeb32de06ee
you need to be using the
https
scheme when accessing your railway app^ and make sure you have a POST handler on that route. 404 usually means you're not handling POST requests for the route (the technically correct status code is 405, but frameworks are weird)
But the point is... i already deployed this API... but when i make it the first time, this exactly same POST route worked
for the reason the project is private, i can't show much of the API, but root index.js is something like that, i don't know if that will help...
The API is made using Node.Js with Express
use https before you try anything else
does the POST request work locally?
Yes
use https when accessing your app through the railway domain, problem solved
locking thread now