9 months ago
I recently deployed my Node.js API to Railway, and I’m running into a strange issue—whenever I send a POST request, it’s being received as a GET on the server. I’ve double-checked my routes and middleware in Express, and everything works fine locally.
I also tested using curl like this:
curl -X POST https://myapp.up.railway.app/api/endpoint -H "Content-Type: application/json" -d '{"test":"data"}'
then i went to my service in the railway dash. under "HTTP Logs" i can see that post show up there as GET
Pinned Solution
8 months ago
Run
curl -v -X POST https://youapp.up.railway.app/api/pulse/events -H "Content-Type: application/json" -d '{"test":"data"}'
See if there is 301 redirect happening.
Remember to replace yourapp in the command.
Also when pasting screenshots remember to blur your public url.
8 Replies
Status changed to Awaiting User Response Railway • 9 months ago
itsrems
Heya, can you link the project/service please ?
9 months ago
Status changed to Awaiting Railway Response Railway • 9 months ago
Status changed to Awaiting User Response Railway • 9 months ago
itsrems
that domain points to a service that is not deployed yet
9 months ago
Well im new to Railway so maybe something simple. However I am receiving my requests as GET so does that mean its something else?
Status changed to Awaiting Railway Response Railway • 9 months ago
itsrems
that domain points to a service that is not deployed yet
9 months ago
here is a better look
Attachments
Status changed to Awaiting User Response Railway • 9 months ago
itsrems
Heya, unfortunately I'm unable to reproduce this.
9 months ago
hmm. what are next steps?
8 months ago
Run
curl -v -X POST https://youapp.up.railway.app/api/pulse/events -H "Content-Type: application/json" -d '{"test":"data"}'
See if there is 301 redirect happening.
Remember to replace yourapp in the command.
Also when pasting screenshots remember to blur your public url.
Status changed to Solved chandrika • 7 months ago

