json mashal instead of struct in body
This commit is contained in:
@@ -8,10 +8,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (c *Client) executeRequest(ctx context.Context, request FiscalRequest, response interface{}) error {
|
func (c *Client) executeRequest(ctx context.Context, request FiscalRequest, response interface{}) error {
|
||||||
|
reqJson, err := json.Marshal(request)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to marshal request: %w", err)
|
||||||
|
}
|
||||||
|
fmt.Println(string(reqJson))
|
||||||
|
|
||||||
resp, err := c.resty.R().
|
resp, err := c.resty.R().
|
||||||
SetContext(ctx).
|
SetContext(ctx).
|
||||||
SetHeader("Authorization", c.token).
|
SetHeader("Authorization", c.token).
|
||||||
SetBody(request).
|
SetBody(reqJson).
|
||||||
Post(c.apiBaseURL + "/fiscal/execute")
|
Post(c.apiBaseURL + "/fiscal/execute")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user