go-json-rest-examples

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2014 License: MIT

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

MIT License

Analytics

Directories

Path Synopsis
Demonstrate a possible global Basic Auth implementation The Curl Demo: curl -i http://127.0.0.1:8080/countries
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 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
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
gae
gaecountries
Demonstrate a simple Google App Engine app 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
Demonstrate a simple Google App Engine app 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
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
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
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 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 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.
Demonstrate how to use rest.RouteObjectMethod rest.RouteObjectMethod helps create a Route that points to an object method instead of just a function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL