diff --git a/alipay/common_api.go b/alipay/common_api.go index 2dc3cd99..16701a87 100644 --- a/alipay/common_api.go +++ b/alipay/common_api.go @@ -178,7 +178,7 @@ func systemOauthToken(ctx context.Context, appId string, privateKey *rsa.Private if !isProd { baseUrl = sandboxBaseUrlUtf8 } - _, bs, err = xhttp.NewClient().Req(xhttp.TypeForm).Post(baseUrl).SendString(bm.EncodeURLParams()).EndBytes(ctx) + _, bs, err = xhttp.NewClient().Req(xhttp.TypeFormData).Post(baseUrl).SendString(bm.EncodeURLParams()).EndBytes(ctx) if err != nil { return nil, err } @@ -218,7 +218,7 @@ func MonitorHeartbeatSyn(ctx context.Context, appId string, privateKey, signType } bm.Set("sign", sign) - _, bs, err = xhttp.NewClient().Req(xhttp.TypeForm).Post(baseUrlUtf8).SendString(bm.EncodeURLParams()).EndBytes(ctx) + _, bs, err = xhttp.NewClient().Req(xhttp.TypeFormData).Post(baseUrlUtf8).SendString(bm.EncodeURLParams()).EndBytes(ctx) if err != nil { return nil, err } diff --git a/alipay/customs.go b/alipay/customs.go index 7cfcdf65..f1b9f28b 100644 --- a/alipay/customs.go +++ b/alipay/customs.go @@ -79,7 +79,7 @@ func (a *Client) doAliPayCustoms(ctx context.Context, bm gopay.BodyMap, service xlog.Debugf("Alipay_Request: %s", bm.JsonBody()) } // request - res, bs, err := a.hc.Req(xhttp.TypeForm).Post("https://mapi.alipay.com/gateway.do").SendString(bm.EncodeURLParams()).EndBytes(ctx) + res, bs, err := a.hc.Req(xhttp.TypeFormData).Post("https://mapi.alipay.com/gateway.do").SendString(bm.EncodeURLParams()).EndBytes(ctx) if err != nil { return nil, err }