http

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyTransport

type MyTransport struct {
	Transport http.RoundTripper
}

func (*MyTransport) RoundTrip

func (t *MyTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Response

type Response struct {
	Text       string
	StatusCode int
}

func Get

func Get(client *Session, url string) (*Response, error)

func Post

func Post(client *Session, url, body string) (*Response, error)

func (*Response) J

func (resp *Response) J(expression string) interface{}

func (*Response) Json

func (resp *Response) Json() map[string]interface{}

type ResponseT added in v1.1.4

type ResponseT[T any] struct {
	Response
	Value T
}

func GetAndUnmarshal added in v1.1.4

func GetAndUnmarshal[T any](client *Session, url string) (*ResponseT[T], error)

func PostAndUnmarshal added in v1.1.4

func PostAndUnmarshal[T any](client *Session, url, body string) (*ResponseT[T], error)

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(timeOut time.Duration) *Session

Jump to

Keyboard shortcuts

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