Post Requests working locally, not working deployed
Title. This is my first time running an endpoint in railway with a post request. all gets are working fine, and the post worked locally.
32 Replies
Project ID:
db735447-598c-455d-b1be-6718e98e1aff
Any errors?
first thing to try, make sure you are using https when making requests to your app
db735447-598c-455d-b1be-6718e98e1aff
ill copy the curl command here, sec
curl --header "Content-Type:application/json" --header "api-key: fake-api-key" -d '{"queries": [{"wallet_id": "SP1SS7CFBRM82Z1BSWSD6ZEFFEQY6YCSEC1H1235J", "block_height": "132420", "ticker": "stxs"},{"wallet_id": "SPWVKHWDQCPCS3QFYTWGNQYA72WZKQKR41S1N1XF", "block_height": "132416", "ticker": "fess"}]}' -X POST --url "https://satscreener-api.up.railway.app/api/v1/stx20/batch_balance_on_block"
some html that says error, cannot POST
the exact same query works locally
also, unrelated, but i saw people were asking why their bills were projected really high
and i also saw a random 3mb network bump in my postgres service metrics
Unrelated to that (i know, confusing), i was NOT using private urls which was obviously causing my costs to balloon up. I now use private urls.alright you are using https, so back to fragly's question
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/v1/stx20/batch_balance_on_block</pre>
</body>
</html>
that's the response
i just get a 401 json response
i can see you attempting to curl it
can you send me your command?
mines formatted wrong, somehow
im not using curl
teach me the ways
what ya using
im using yaak
is that CLI?
no - https://yaak.app/
downloading
still getting 404s
what am i doing wrong...
screenshot please
now show me the same thing but posting to your locally running app
maybe it's an issue with deployment. idk
I meant with yaak
it's pointing at a different database, but it doesn't matter since the error is at api level
all i did was change the url, everythings the same
huh wait
it is an issue with the database
cant connect to the database?
omg
im sorry
its a devops issue over here
never deployed the new api code to railway
haha yeah i knew this wasnt an issue with railway, so no worries
yeah wow that really threw me for a loop. Thanks for showing me yaak
is this abnormal though?
i dont know what your app does or how you are using the database so i cant say
does railway have a way of generating docs for an api?
or is there anything you'd recommend?
that wouldnt be something railway would do, so try swagger?
yeah but you recommended yaak
nice product. I've used swagger before
swagger it is then