You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/service/leshuazf/api.go

26 lines
729 B

package leshuazf
import (
"context"
"github.com/baidubce/bce-sdk-go/http"
"github.com/dtapps/go-library/utils/gorequest"
)
func (c *Client) Get(ctx context.Context, _method string, notMustParams ...gorequest.Params) ([]byte, error) {
// 参数
params := gorequest.NewParamsWith(notMustParams...)
// 请求
request, err := c.request(ctx, apiUrl+_method, params, http.GET)
// 定义
return request.ResponseBody, err
}
func (c *Client) Post(ctx context.Context, _method string, notMustParams ...gorequest.Params) ([]byte, error) {
// 参数
params := gorequest.NewParamsWith(notMustParams...)
// 请求
request, err := c.request(ctx, apiUrl+_method, params, http.POST)
// 定义
return request.ResponseBody, err
}