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 {
|
||||
BrandID string `json:"brandId"`
|
||||
ExtraData bool `json:"extraData,omitempty"`
|
||||
ExtraData bool `json:"extraData"`
|
||||
Size int `json:"size,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("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)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
fmt.Println("Request URL:", c.BaseURL+path)
|
||||
fmt.Println("Request Headers:")
|
||||
fmt.Println(" Content-Type: application/json")
|
||||
fmt.Println(" signature:", sig)
|
||||
fmt.Println("Request Body:", string(data))
|
||||
|
||||
// Read response
|
||||
b, _ := io.ReadAll(res.Body)
|
||||
if res.StatusCode >= 400 {
|
||||
return fmt.Errorf("error: %s", b)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user