In a <a href="http://ernestmicklei.com/2012/11/11/go-restful-api-design/">previous post</a>, I discussed the design of <a href="http://go.pkgdoc.org/github.com/emicklei/go-restful">go-restful</a> which is a package for building REST-style WebServices using the Google Go programming language. Today, I completed the implementation of that package which provides the basics: Creating a WebService with Routes (mapping between Http Request and a Go function) Each Route requires information about the Http method (GET,POST,...), URL Path (/users..), Mime-types and the function it binds to Functions get passed in a Request and a Response The Request is used to access Path and Query parameters , Headers and request content (XML, JSON,.
I have been using <a title="JAX-RS" href="http://jax-rs-spec.java.net/">JAX-RS</a> for many REST-based service implementations in Java. As part of my journey into the Google Go programming language, I am exploring designs for such REST support using the standard net/http package in Go. JAX-RS provides a set of Annotation classes which can be used to add meta-data to classes, methods and method arguments. In JAX-RS these annotation are used to specify the mapping between a Http Request to a Java method and its arguments.