http

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do() *resty.Client

Do returns the client, so it can be used to do requests

Types

type HttpError

type HttpError struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
	Status           int
}

HttpError is a type for returning the server's error response including its status code

func Get

func Get(url string, params url.Values, res interface{}) (*resty.Response, *HttpError, error)

Get performs a http GET request and parses the response into the given interface{}

func Post

func Post(url string, req interface{}, res interface{}, headers map[string]string) (
	*resty.Response, *HttpError, error,
)

Post performs an http POST request and parses the response into the given interface{}

func (*HttpError) Err

func (e *HttpError) Err() error

Err returns an error including the server's error response

Jump to

Keyboard shortcuts

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