Documentation
¶
Overview ¶
This sample demonstrates how to use sessions to maintain state across multiple requests. It implements a shopping cart where items persist between calls using the session API.
To run:
go run .
In another terminal, test (items persist across requests):
curl -X POST http://localhost:8080/manageCart \
-H "Content-Type: application/json" \
-d '{"data": "Add apples and bananas to my cart"}'
curl -X POST http://localhost:8080/manageCart \
-H "Content-Type: application/json" \
-d '{"data": "What is in my cart?"}'
Click to show internal directories.
Click to hide internal directories.