Documentation ¶
Index ¶
- Variables
- type HttpClient
- type HttpMethod
- type HttpRequest
- type HttpRequestBody
- type HttpRequestHeaders
- func (r *HttpRequestHeaders) Add(key, value string) error
- func (r *HttpRequestHeaders) Get(key string) ([]string, error)
- func (r *HttpRequestHeaders) GetAll() (map[string][]string, error)
- func (r *HttpRequestHeaders) List() ([]string, error)
- func (r *HttpRequestHeaders) Set(key string, values ...string) error
- type HttpRequestMethod
- type HttpRequestOption
- type HttpResponse
- type HttpResponseBody
Constants ¶
This section is empty.
Variables ¶
View Source
var AddHttpRequestHeader = func(clientId uint32, requestId uint32, key string, value string, ) (error errno.Error) { return errno.ErrorNone }
View Source
var CloseHttpResponseBody = func(clientId uint32, requestId uint32) (error errno.Error) { return errno.ErrorNone }
View Source
var DeleteHttpRequestHeader = func(clientId uint32, requestId uint32, key string, ) (error errno.Error) { return errno.ErrorNone }
View Source
var DoHttpRequest = func(clientId uint32, requestId uint32) (error errno.Error) { return errno.ErrorNone }
View Source
var GetHttpRequestHeader = func(clientId uint32, requestId uint32, key string, headerPtr *byte, ) (error errno.Error) { return errno.ErrorNone }
View Source
var GetHttpRequestHeaderKeys = func(clientId uint32, requestId uint32, headerPtr *byte, headerSize uint32, ) (error errno.Error) { return errno.ErrorNone }
View Source
var GetHttpRequestHeaderKeysSize = func(clientId uint32, requestId uint32, sizePtr *uint32, ) (error errno.Error) { return errno.ErrorNone }
View Source
var GetHttpRequestHeaderSize = func(clientId uint32, requestId uint32, key string, sizePtr *uint32, ) (error errno.Error) { return errno.ErrorNone }
View Source
var GetHttpRequestMethod = func(clientId uint32, requestId uint32, methodPtr *uint32) (error errno.Error) { return errno.ErrorNone }
View Source
var NewHttpClient = func(clientId *uint32) (error errno.Error) { return errno.ErrorNone }
View Source
var NewHttpRequest = func(clientId uint32, requestIdPtr *uint32) (error errno.Error) { return errno.ErrorNone }
View Source
var ReadHttpResponseBody = func(clientId uint32, requestId uint32, buf *byte, bufSize uint32, countPtr *uint32) (error errno.Error) { return errno.ErrorNone }
View Source
var SetHttpRequestBody = func(clientId uint32, requestId uint32, data *byte, dataSize uint32) (error errno.Error) { return errno.ErrorNone }
View Source
var SetHttpRequestHeader = func(clientId uint32, requestId uint32, key string, valuesPtr *byte, valuesSize uint32, ) (error errno.Error) { return errno.ErrorNone }
Functions ¶
This section is empty.
Types ¶
type HttpClient ¶
type HttpClient uint32
func New ¶
func New() (HttpClient, error)
func (HttpClient) Request ¶
func (c HttpClient) Request(url string, options ...HttpRequestOption) (HttpRequest, error)
type HttpMethod ¶
type HttpMethod uint32
const ( UNKNOWN HttpMethod = iota GET POST PUT DELETE HEAD OPTIONS PATCH TRACE CONNECT )
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
func (*HttpRequest) Body ¶
func (r *HttpRequest) Body() *HttpRequestBody
func (*HttpRequest) Do ¶
func (r *HttpRequest) Do() (*HttpResponse, error)
func (*HttpRequest) Headers ¶
func (r *HttpRequest) Headers() *HttpRequestHeaders
func (*HttpRequest) Method ¶
func (r *HttpRequest) Method() *HttpRequestMethod
type HttpRequestBody ¶
type HttpRequestBody HttpRequest
func (*HttpRequestBody) Set ¶
func (r *HttpRequestBody) Set(data []byte) error
type HttpRequestHeaders ¶
type HttpRequestHeaders HttpRequest
func (*HttpRequestHeaders) Add ¶
func (r *HttpRequestHeaders) Add(key, value string) error
func (*HttpRequestHeaders) GetAll ¶
func (r *HttpRequestHeaders) GetAll() (map[string][]string, error)
func (*HttpRequestHeaders) List ¶
func (r *HttpRequestHeaders) List() ([]string, error)
type HttpRequestMethod ¶
type HttpRequestMethod HttpRequest
func (*HttpRequestMethod) Get ¶
func (r *HttpRequestMethod) Get() (string, error)
func (*HttpRequestMethod) Set ¶
func (r *HttpRequestMethod) Set(method string) error
type HttpRequestOption ¶
type HttpRequestOption func(HttpRequest) error
func Body ¶
func Body(data []byte) HttpRequestOption
func Headers ¶
func Headers(headers map[string][]string) HttpRequestOption
func Method ¶
func Method(method string) HttpRequestOption
type HttpResponse ¶
type HttpResponse struct {
// contains filtered or unexported fields
}
func (*HttpResponse) Body ¶
func (resp *HttpResponse) Body() *HttpResponseBody
type HttpResponseBody ¶
type HttpResponseBody HttpResponse
func (*HttpResponseBody) Close ¶
func (resp *HttpResponseBody) Close() error
Click to show internal directories.
Click to hide internal directories.