HTTP/S Clients


The following are a few examples of increasingly customizable HTTP/S clients. Please consult Go's http/net documentation.

You can download all examples as a zip file.

This example shows a high-level interface for issuing an HTTP GET request:

httpclient/get.go


      

This example creates a Client to customize behavior, such as timeouts.

httpclient/client-get.go


      

This example creates a Request by hand.

httpclient/client-do.go


      

This example further customizes a client with Transport, which allows for configuration of TLS.

httpclient/client-transport.go


      

This example shows how to modify request headers and view response headers.

httpclient/headers.go