Skip to content

Glossary: Go in Practice

http.NewRequestWithContext

Also written: Do, c.HTTP.Do, resp.StatusCode, resp.Body.Close

Builds an HTTP request tied to a context. `Do` sends it, `resp.StatusCode` must be checked yourself, and `defer resp.Body.Close()` keeps connections from piling up.

Where the book teaches it

Related terms

http.ClientQuery string