http

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEADER_APPID    = "Bcs-Api-AppId"
	HEADER_APPCODE  = "Bcs-Api-AppCode"
	HEADER_APPTOKEN = "Bcs-Api-AppToken"
	HEADER_OPERATOR = "Bcs-Api-Operator"
)

Variables

This section is empty.

Functions

func GetRespWithoutData

func GetRespWithoutData(code int, message string) string

func GetRespWithoutDataEx

func GetRespWithoutDataEx(code int, message string) []byte

func GetRespone

func GetRespone(code int, message string, data interface{}) string

GetRespone deprecated: best to use GetResponse instead.

func GetResponse

func GetResponse(code int, message string, data interface{}) ([]byte, error)

GetResponse adaptor

func GetResponseEx

func GetResponseEx(code int, message string, data interface{}, extra map[string]interface{}) ([]byte, error)

GetResponseEx extension adaptor

func InternalError

func InternalError(code int, message string) error

InternalError internal error type exchange

func InternalErrorEx

func InternalErrorEx(code int, message string) ([]byte, error)

InternalErrorEx internal error type exchange

func Request

func Request(url, method string, header http.Header, body io.Reader) (string, error)

Request http request encapsulation

func RequestV2

func RequestV2(url, method string, headSet []*HeaderSet, body io.Reader) (string, error)

RequestV2 v2 version for http request encapsulation

Types

type APIRespone

type APIRespone struct {
	Result  bool        `json:"result"`
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

APIResponse response for api request

type HeaderSet

type HeaderSet struct {
	Key   string
	Value string
}

HeaderSet http header set

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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