a year 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
a year 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 • about 1 year ago
nico
Heya, can you link the project/service please ?
a year ago
Status changed to Awaiting Railway Response Railway • about 1 year ago
Status changed to Awaiting User Response Railway • about 1 year ago
nico
that domain points to a service that is not deployed yet 🤔
a year 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 • about 1 year ago
nico
that domain points to a service that is not deployed yet 🤔
a year ago
here is a better look
Attachments
Status changed to Awaiting User Response Railway • about 1 year ago
nico
Heya, unfortunately I'm unable to reproduce this.
a year ago
hmm. what are next steps?
a year 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 • 11 months ago