requests

package
v0.3.10-0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUrlFormedMap

func GetUrlFormedMap(source map[string]string) string

Types

type IRequest

type IRequest interface {
	GetScheme() string
	GetMethod() string
	GetEndpoint() string
	GetPort() string
	GetRegionId() string
	GetProjectId() string
	GetHost() string
	GetURI() string
	GetHeaders() map[string]string
	GetQueryParams() map[string]string
	GetFormParams() map[string]string
	GetContent() []byte
	GetBodyReader() io.Reader
	GetProduct() string
	GetVersion() string

	SetStringToSign(stringToSign string)
	GetStringToSign() string

	SetContent(content []byte)
	SetScheme(scheme string)
	BuildUrl() string
	BuildQueries() string

	AddHeaderParam(key, value string)
	AddQueryParam(key, value string)
	AddFormParam(key, value string)
}

type SRequest

type SRequest struct {
	Scheme   string // HTTP、HTTPS
	Method   string // GET、PUT、DELETE、POST、PATCH
	Endpoint string // ecs.cn-north-1.myhuaweicloud.com
	Port     string // 80
	RegionId string // cn-north-1

	QueryParams map[string]string
	Headers     map[string]string
	FormParams  map[string]string
	Content     []byte
	// contains filtered or unexported fields
}

func NewResourceRequest

func NewResourceRequest(endpoint, method, product, version, region, project, resourcePath string) *SRequest

func (*SRequest) AddFormParam

func (self *SRequest) AddFormParam(key, value string)

func (*SRequest) AddHeaderParam

func (self *SRequest) AddHeaderParam(key, value string)

func (*SRequest) AddQueryParam

func (self *SRequest) AddQueryParam(key, value string)

func (*SRequest) BuildQueries

func (self *SRequest) BuildQueries() string

func (*SRequest) BuildUrl

func (self *SRequest) BuildUrl() string

func (*SRequest) GetBodyReader

func (self *SRequest) GetBodyReader() io.Reader

func (*SRequest) GetContent

func (self *SRequest) GetContent() []byte

func (*SRequest) GetEndpoint

func (self *SRequest) GetEndpoint() string

func (*SRequest) GetFormParams

func (self *SRequest) GetFormParams() map[string]string

func (*SRequest) GetHeaders

func (self *SRequest) GetHeaders() map[string]string

func (*SRequest) GetHost

func (self *SRequest) GetHost() string

func (*SRequest) GetMethod

func (self *SRequest) GetMethod() string

func (*SRequest) GetPort

func (self *SRequest) GetPort() string

func (*SRequest) GetProduct

func (self *SRequest) GetProduct() string

func (*SRequest) GetProjectId

func (self *SRequest) GetProjectId() string

func (*SRequest) GetQueryParams

func (self *SRequest) GetQueryParams() map[string]string

func (*SRequest) GetRegionId

func (self *SRequest) GetRegionId() string

func (*SRequest) GetScheme

func (self *SRequest) GetScheme() string

func (*SRequest) GetStringToSign

func (self *SRequest) GetStringToSign() string

func (*SRequest) GetURI

func (self *SRequest) GetURI() string

func (*SRequest) GetVersion

func (self *SRequest) GetVersion() string

func (*SRequest) SetContent

func (self *SRequest) SetContent(content []byte)

func (*SRequest) SetScheme

func (self *SRequest) SetScheme(scheme string)

func (*SRequest) SetStringToSign

func (self *SRequest) SetStringToSign(stringToSign string)

Jump to

Keyboard shortcuts

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