veli games signature extraData field issue fix
This commit is contained in:
parent
3310e01ccc
commit
7d2db5801c
|
|
@ -2,7 +2,7 @@ package domain
|
||||||
|
|
||||||
type ProviderRequest struct {
|
type ProviderRequest struct {
|
||||||
BrandID string `json:"brandId"`
|
BrandID string `json:"brandId"`
|
||||||
ExtraData bool `json:"extraData,omitempty"`
|
ExtraData bool `json:"extraData"`
|
||||||
Size int `json:"size,omitempty"`
|
Size int `json:"size,omitempty"`
|
||||||
Page int `json:"page,omitempty"`
|
Page int `json:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,18 +79,24 @@ func (c *Client) post(ctx context.Context, path string, body any, sigParams map[
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
req.Header.Set("signature", sig)
|
req.Header.Set("signature", sig)
|
||||||
|
|
||||||
|
// Print request info
|
||||||
|
fmt.Println("Request URL:", c.BaseURL+path)
|
||||||
|
fmt.Println("Request Headers:")
|
||||||
|
for k, v := range req.Header {
|
||||||
|
for _, val := range v {
|
||||||
|
fmt.Printf(" %s: %s\n", k, val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println("Request Body:", string(data))
|
||||||
|
|
||||||
|
// Send request
|
||||||
res, err := c.http.Do(req)
|
res, err := c.http.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
fmt.Println("Request URL:", c.BaseURL+path)
|
// Read response
|
||||||
fmt.Println("Request Headers:")
|
|
||||||
fmt.Println(" Content-Type: application/json")
|
|
||||||
fmt.Println(" signature:", sig)
|
|
||||||
fmt.Println("Request Body:", string(data))
|
|
||||||
|
|
||||||
b, _ := io.ReadAll(res.Body)
|
b, _ := io.ReadAll(res.Body)
|
||||||
if res.StatusCode >= 400 {
|
if res.StatusCode >= 400 {
|
||||||
return fmt.Errorf("error: %s", b)
|
return fmt.Errorf("error: %s", b)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user