All POST request is changing to GET

dayglorPRO

a year ago

I have an application that make a CRUD.
But the only request method working is GET.

If I send a POST request, the request reaches the server as GET.

If I run this project on localhost with docker the request works fine. I hosted this project on AWS on an EC2 and the requests work fine, only on railway my request is changing from POST to GET.

Below is the request log

Preparing request to http://xxxx.up.railway.app/your-endpoint

* Current time is 2024-07-16T22:04:07.532Z

* Enable automatic URL encoding

* Using default HTTP version

* Enable timeout of 30000ms

* Enable SSL validation

* Hostname xxxx.up.railway.app was found in DNS cache

*   Trying 34.86.119.124:80...

* Connected to xxxx.up.railway.app (34.86.119.124) port 80 (#106)

> POST /your-endpoint HTTP/1.1

> Host: xxxx.up.railway.app

> Content-Type: application/json

> User-Agent: insomnia/9.2.0

> Accept: /

> Content-Length: 69

| {

| 	"email": "email-usuario10@emai.com.br",

| 	"password": "xxxxxxxxxx"

| }

* Mark bundle as not supporting multiuse

< HTTP/1.1 301 Moved Permanently

< location: https://xxxx.up.railway.app/your-endpoint

< date: Tue, 16 Jul 2024 22:04:00 GMT

< server: railway

< connection: close

< content-length: 0

* Closing connection 106

* Issue another request to this URL: 'https://xxxx.up.railway.app/your-endpoint'

* Switch from POST to GET

* Found bundle for host xxxx.up.railway.app: 0x13805cda500 [can multiplex]

* Re-using existing connection! (#97) with host xxxx.up.railway.app

* Connected to xxxx.up.railway.app (34.86.119.124) port 443 (#97)

* Using Stream ID: 15 (easy handle 0x13800906000)

* TLSv1.2 (OUT), TLS header, Supplemental data (23):

> GET /your-endpoint HTTP/2

> Host: xxxx.up.railway.app

> content-type: application/json

> user-agent: insomnia/9.2.0

> accept: /

* TLSv1.2 (IN), TLS header, Supplemental data (23):

< HTTP/2 404 

< x-powered-by: Express

< access-control-allow-origin: *

< content-security-policy: default-src 'none'

< x-content-type-options: nosniff

< content-type: text/html; charset=utf-8

< content-length: 152

< date: Tue, 16 Jul 2024 22:04:08 GMT

< server: railway

* Received 152 B chunk

* Connection #97 to host xxxx.up.railway.app left intact
Solved

2 Replies

a year ago

You are making a request with http, the request needs to be done with https.


dayglorPRO

a year ago

Ohhhh God!

You are right!

Thank you soo much! You are the best...


Status changed to Solved brody 11 months ago


All POST request is changing to GET - Railway Help Station