Examples using... "net/http/httptest"

Recent
ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
DumpResponse is like DumpRequest but dumps a response.
DumpRequest returns the given request in its HTTP/1.x wire representation. It should only be used by servers to debug client requests. The returned representation is an approximation only; some details of the initial request are lost while parsing it into an http.Request. In particular, the order an...
A Server is an HTTP server listening on a system-chosen port on the local loopback interface, for use in end-to-end HTTP tests.
ResponseRecorder is an implementation of http.ResponseWriter that records its mutations for later inspection in tests.
NewTLSServer starts and returns a new Server using TLS. The caller should call Close when finished, to shut it down.
New returns a new cookie jar. A nil *Options is equivalent to a zero Options.
A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified. A Config may be reused; the tls package will also not modify it.