http

package
v0.0.0-...-8c2001a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Http

type Http interface {
	HttpRaw(*HttpRequest) *HttpResponse
	HttpRawBatch([]*HttpRequest) []*HttpResponse

	HttpQuickGet(url string, headers map[string]string) ([]byte, error)
	HttpQuickPost(url string, headers map[string]string, data []byte) ([]byte, error)
	HttpFormPost(url string, headers map[string]string, data []byte) ([]byte, error)

	HttpJsonGet(url string, headers map[string]string) ([]byte, error)
	HttpJsonPost(url string, headers map[string]string, data []byte) ([]byte, error)
}

func New

func New() Http

type HttpRequest

type HttpRequest struct {
	Method  string            `json:"method,omitempty"`
	Path    string            `json:"path,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
	Body    []byte            `json:"body,omitempty"`
}

type HttpResponse

type HttpResponse struct {
	SatusCode int                 `json:"status_code,omitempty"`
	Headers   map[string][]string `json:"headers,omitempty"`
	Body      []byte              `json:"body,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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