myhttp

package
Version: v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: GPL-3.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Client  = "cli"
	Backend = "back"
)

ConnType ...

Variables

This section is empty.

Functions

func AddHeader

func AddHeader(w *http.ResponseWriter)

AddHeader add request header

func Option

func Option(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

Option add header option

func PostData

func PostData(r *http.Request) map[string]interface{}

PostData get http post data

Types

type RESTfulURL

type RESTfulURL struct {
	RequestType string
	URL         string
	Fun         httprouter.Handle
	ConnType    string
}

RESTfulURL ...

type Service

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

Service ...

func (*Service) ConnectPool

func (s *Service) ConnectPool() *http.Client

ConnectPool ...

func (*Service) GET

func (s *Service) GET(url string, heard map[string][]string) ([]byte, error)

GET ...

func (*Service) HTTPGet

func (s *Service) HTTPGet(url string, values map[string][]string) ([]byte, error)

HTTPGet ...

func (*Service) HTTPPostRawRequest

func (s *Service) HTTPPostRawRequest(url string, value []byte) ([]byte, error)

HTTPPostRawRequest Http Raw Request

func (*Service) HTTPPostRequest

func (s *Service) HTTPPostRequest(url string, values map[string][]string) ([]byte, error)

HTTPPostRequest ...

func (*Service) POST

func (s *Service) POST(url string, value []byte, header map[string][]string) ([]byte, error)

POST Http Raw Request

func (*Service) PUT

func (s *Service) PUT(url string, value []byte, header map[string][]string) ([]byte, error)

PUT Http Raw Request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL