helpers

package
v0.69.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package helpers provides utility functions for working with HTTP requests and responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSONBody

func DecodeJSONBody(resp *http.Response, value any) error

func Fetch

func Fetch(ctx context.Context, req *http.Request, dst io.Writer) error

func FetchToFile

func FetchToFile(ctx context.Context, req *http.Request, dst string) error

FetchToFile downloads the file from the given `url` into the specified `dst` file.

func ModifyJSONBody

func ModifyJSONBody(resp *http.Response, value any, fn func() error) error

func ResponseBuffer

func ResponseBuffer(resp *http.Response) (*bytes.Buffer, error)

func ResponseReader

func ResponseReader(resp *http.Response) (io.ReadCloser, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL