Skip to content

Latest commit

 

History

History
45 lines (41 loc) · 1.03 KB

README.md

File metadata and controls

45 lines (41 loc) · 1.03 KB

Rust

start api

cargo run

Testing curls

After you update the code, restart the server via cargo run and use these curls to post, update, get, and delete items.

POST

--header 'Content-Type: application/json' \
--header 'Content-Type: text/plain' \
--data-raw '{
    "name": "apple",
    "quantity": 3
}'

UPDATE

curl --location --request PUT 'localhost:3030/v1/basket' \
--header 'Content-Type: application/json' \
--header 'Content-Type: text/plain' \
--data-raw '{
    "name": "apple",
    "quantity": 5
}'

GET

curl --location --request GET 'localhost:3030/v1/basket' \
--header 'Content-Type: application/json' \
--header 'Content-Type: text/plain'

DELETE

curl --location --request DELETE 'localhost:3030/v1/basket' \
--header 'Content-Type: application/json' \
--header 'Content-Type: text/plain' \
--data-raw '{
    "name": "apple"
}'