Skip to content

Instantly share code, notes, and snippets.

View NanzhuLin's full-sized avatar

Jack Lin NanzhuLin

View GitHub Profile
# Clear the cookies
$ rm cookies.txt
# Create a user
$ curl -v -b cookies.txt -c cookies.txt -X POST 127.0.0.1:8080/api/v0.1/employees -d '{"employeeId":666, "password":"hello"}'
HTTP/1.1 201 Created
# Try querying without auth
$ curl -v -b cookies.txt -c cookies.txt -X GET 127.0.0.1:8080/api/v0.1/employees
HTTP/1.1 401 Unauthorized