> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/all/go/request.md).

# request

```go
import (
    "fmt"
    "net/http"
    "io/ioutil"
)
```

Get returns http.Response

```go
resp, err := http.Get(url)
checkErr(err)

fmt.Printf("Response type: %T\n", resp)
```

## Work with Data

```go
resp, err := http.Get(url)
checkErr(err)

defer resp.Body.Close()

bytes, err := ioutil.ReadAll(resp.Body)
checkErr(err)

content := string(bytes)
```
