Documentation ¶
Index ¶
- Constants
- Variables
- type RockHttp
- func (rockhttp *RockHttp) Do(ctx context.Context, url string, method string, header *http.Header, ...) (*http.Response, error)
- func (rockhttp *RockHttp) DoRequest(req *http.Request) (*http.Response, error)
- func (rockhttp *RockHttp) DoResBytes(req *http.Request) ([]byte, error)
- func (rockhttp *RockHttp) DoResJson(req *http.Request, obj any) error
- func (rockhttp *RockHttp) DoResProtoJson(req *http.Request, message proto.Message) error
- func (rockhttp *RockHttp) DoResProtoMessage(req *http.Request, message *proto.Message) error
- func (rockhttp *RockHttp) Get(ctx context.Context, url string, header *http.Header) ([]byte, error)
- func (rockhttp *RockHttp) GetResponse(ctx context.Context, url string, header *http.Header) (*http.Response, error)
- func (rockhttp *RockHttp) PostForm(ctx context.Context, url string, data url.Values, headerArg *http.Header) ([]byte, error)
- func (rockhttp *RockHttp) UploadFile(ctx context.Context, url string, method string, header *http.Header, ...) (*http.Response, error)
- func (rockhttp *RockHttp) UploadFileResBytes(ctx context.Context, url string, method string, header *http.Header, ...) ([]byte, error)
Constants ¶
View Source
const TAG = "RockHttp"
Variables ¶
View Source
var HttpClient = NewRockHttpClient()
Functions ¶
This section is empty.
Types ¶
type RockHttp ¶
type RockHttp struct {
// contains filtered or unexported fields
}
func NewRockHttpClient ¶
func NewRockHttpClient() *RockHttp
func (*RockHttp) DoResBytes ¶
读取response.Body 的bytes
func (*RockHttp) DoResProtoJson ¶
json格式的bytes 转为 proto-Message
func (*RockHttp) DoResProtoMessage ¶
结果proto格式的bytes 转为 proto-Message
func (*RockHttp) GetResponse ¶
Click to show internal directories.
Click to hide internal directories.