Book Image

Go Programming Blueprints

By : Mat Ryer
Book Image

Go Programming Blueprints

By: Mat Ryer

Overview of this book

Table of Contents (17 chapters)
Go Programming Blueprints
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

RESTful API design


For an API to be considered RESTful, it must adhere to a few principles that stay true to the original concepts behind the Web, and are already known to most developers. Such an approach allows us to make sure we aren't building anything strange or unusual into our API while also giving our users a head start towards consuming it, since they are already familiar with its concepts.

Some of the most important RESTful design concepts are:

  • HTTP methods describe the kind of action to take, for example, GET methods will only ever read data, while POST requests will create something

  • Data is expressed as a collection of resources

  • Actions are expressed as changes to data

  • URLs are used to refer to specific data

  • HTTP headers are used to describe the kind of representation coming into and going out of the server

Note

For an in-depth overview of these and other details of RESTful designs, see the Wikipedia article at http://en.wikipedia.org/wiki/Representational_state_transfer.

The following...