diff --git a/allinpay/client.go b/allinpay/client.go index 82a9e36e..31f1f108 100644 --- a/allinpay/client.go +++ b/allinpay/client.go @@ -127,7 +127,7 @@ func (c *Client) doPost(ctx context.Context, path string, bm gopay.BodyMap) (bs if !c.isProd { url = sandboxBaseUrl } - res, bs, err := c.hc.Req(xhttp.TypeForm).Post(url + path).SendString(param).EndBytes(ctx) + res, bs, err := c.hc.Req(xhttp.TypeFormData).Post(url + path).SendString(param).EndBytes(ctx) if err != nil { return nil, err } diff --git a/paypal/access_token.go b/paypal/access_token.go index 0243d0f1..d05e7d71 100644 --- a/paypal/access_token.go +++ b/paypal/access_token.go @@ -24,7 +24,7 @@ func (c *Client) GetAccessToken() (token *AccessToken, err error) { url = baseUrl + getAccessToken // Authorization authHeader := AuthorizationPrefixBasic + base64.StdEncoding.EncodeToString([]byte(c.Clientid+":"+c.Secret)) - req := c.hc.Req(xhttp.TypeForm) + req := c.hc.Req(xhttp.TypeFormData) req.Header.Add(HeaderAuthorization, authHeader) req.Header.Add("Accept", "*/*") // Body