POST to railway service are being received as GET
ohabash
FREEOP

10 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

Solved$10 Bounty

Pinned Solution

phoenixauro
HOBBY

9 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

10 months ago

Heya, can you link the project/service please ?


Status changed to Awaiting User Response Railway 10 months ago


itsrems

Heya, can you link the project/service please ?

ohabash
FREEOP

10 months ago


Status changed to Awaiting Railway Response Railway 10 months ago


10 months ago

that domain points to a service that is not deployed yet thinking emoji


Status changed to Awaiting User Response Railway 10 months ago


itsrems

that domain points to a service that is not deployed yet

ohabash
FREEOP

10 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 10 months ago


itsrems

that domain points to a service that is not deployed yet

ohabash
FREEOP

10 months ago

here is a better look

Attachments


10 months ago

Heya, unfortunately I'm unable to reproduce this.


Status changed to Awaiting User Response Railway 10 months ago


itsrems

Heya, unfortunately I'm unable to reproduce this.

ohabash
FREEOP

10 months ago

hmm. what are next steps?


phoenixauro
HOBBY

9 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 9 months ago


Loading...