How to perform POST requests? #179
-
Reading the docs through and through, maybe I missed something but i couldn't find a POST request example, it seems most, if not all examples are GET requests More over the https://github.com/Sammyjo20/pokeapi-sdk only has GET request too. More specifically is how to pass the POST payload to the request? Any docs on this, or example? I'm building this https://github.com/alphaolomi/json-placeholder, if anyone can submit a draft PR with POST example it will greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @alphaolomi! You should make sure you set your request's To send data have a read through this part of the documentation: https://docs.saloon.dev/the-basics/request-body-data Let me know if you get stuck and let me know what kind of API data the API will accept. I assume it's JSON from the name, |
Beta Was this translation helpful? Give feedback.
Hey @alphaolomi!
You should make sure you set your request's
$method
property to POST (or PUT/PATCH depending on your API) and then Saloon will send a POST request instead of a GET request.To send data have a read through this part of the documentation: https://docs.saloon.dev/the-basics/request-body-data
Let me know if you get stuck and let me know what kind of API data the API will accept. I assume it's JSON from the name,