# README
Examples for go-json-rest
Go-Json-Rest is a thin layer on top of net/http
that helps building RESTful JSON APIs easily.
See the Github repo here: https://github.com/ant0ine/go-json-rest
Copyright (c) 2013-2014 Antoine Imbert
# Packages
Demonstrate a possible global Basic Auth implementation
The Curl Demo:
curl -i http://127.0.0.1:8080/countries
*/.
Demonstrate a possible CORS validation logic
The Curl Demo:
curl -i http://127.0.0.1:8080/countries
*/.
Demonstrate simple POST GET and DELETE operations
The Curl Demo:
curl -i -d '{"Code":"FR","Name":"France"}' http://127.0.0.1:8080/countries
curl -i -d '{"Code":"US","Name":"United States"}' http://127.0.0.1:8080/countries
curl -i http://127.0.0.1:8080/countries/FR
curl -i http://127.0.0.1:8080/countries/US
curl -i http://127.0.0.1:8080/countries
curl -i -X DELETE http://127.0.0.1:8080/countries/FR
curl -i http://127.0.0.1:8080/countries
curl -i -X DELETE http://127.0.0.1:8080/countries/US
curl -i http://127.0.0.1:8080/countries
*/.
No description provided by the author
Demonstrate basic CRUD operation using a store based on MySQL and GORM
The Curl Demo:
curl -i -d '{"Message":"this is a test"}' http://127.0.0.1:8080/reminders
curl -i http://127.0.0.1:8080/reminders/1
curl -i http://127.0.0.1:8080/reminders
curl -i -X PUT -d '{"Message":"is updated"}' http://127.0.0.1:8080/reminders/1
curl -i -X DELETE http://127.0.0.1:8080/reminders/1
*/.
The minimal example from the documentation
The Curl Demo:
curl -i http://127.0.0.1:8080/users/123
*/.
Demonstrate how to use SPDY with github.com/shykes/spdy-go
For a command line client, install spdycat from: https://github.com/tatsuhiro-t/spdylay
Then:
spdycat -v --no-tls -2 http://localhost:8080/users/0
.
Demonstrate a streaming REST API, where the data is "flushed" to the client ASAP.
Demonstrate how to use rest.RouteObjectMethod
rest.RouteObjectMethod helps create a Route that points to
an object method instead of just a function.