Skip to content

Tutorial ToBytes() wrong example #375

Open
@kostas-petrakis

Description

@kostas-petrakis

There is a small mistake in the Get Response body in the documentation.

More specific the example for the ToBytes() is:

body, err := resp.ToString()
if err != nil {
    log.Fatal(err)
}
fmt.Println("body:", body)

I think should be:

resp, err := client.R().Get(url)
if err != nil {
    log.Fatal(err)
}
body, err := resp.ToBytes()
if err != nil {
    log.Fatal(err)
}
fmt.Println("body:", string(body))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions