http/

directory
v0.0.0-...-6749d27 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2016 License: Apache-2.0

README

HTTP - Standard Library

The Go standard library provides all the critical building blocks for producing web sites and APIs.

Notes

  • net/http provides an HTTP/1.1 compliant protocol implementation.
  • There is support for SSL/TLS.
  • Adding routing and middleware to your applications requires only a few simple patterns.

https://golang.org/pkg/net/http
https://golang.org/doc/articles/wiki
https://github.com/bradfitz/http2
https://github.com/interagent/http-api-design/blob/master/README.md
http://www.restapitutorial.com/httpstatuscodes.html
http://racksburg.com/choosing-an-http-status-code
https://blog.cloudflare.com/the-complete-guide-to-golang-net-http-timeouts

Code Review

Hello World Server (Go Playground)
1 Line File Server (Go Playground)
Request and Response Basics (Go Playground)

Advanced Code Review

Web API
Sample code that provides best practices for building a RESTful API in Go. It leverages the standard library except for the router where a package named httptreemux is used. This router provides some nice conveniences such as handling verbs and access to parameters.

Exercises

Exercise 1

TBD


All material is licensed under the Apache License Version 2.0, January 2004.

Directories

Path Synopsis
api
This program provides a sample web service that implements a RESTFul CRUD API against a MongoDB database.
This program provides a sample web service that implements a RESTFul CRUD API against a MongoDB database.
app
Package app provides application support for context and MongoDB access.
Package app provides application support for context and MongoDB access.
handlers
Package handlers contains the handler logic for processing requests.
Package handlers contains the handler logic for processing requests.
models
Package models contains data structures and associated behavior
Package models contains data structures and associated behavior
services
Package services provides business and data processing.
Package services provides business and data processing.
Sample program to show how to implement a handler function with the http package.
Sample program to show how to implement a handler function with the http package.
Sample program to show how you can use the FileServer handle with this service as a single call to ListenAndServe.
Sample program to show how you can use the FileServer handle with this service as a single call to ListenAndServe.
Sample program to show how to use a ServeMux from the standard library.
Sample program to show how to use a ServeMux from the standard library.

Jump to

Keyboard shortcuts

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