SetCommonQueryParamsFromStruct set URL query parameters from a struct using go-querystring for requests fired from the client.
(v any)
| 520 | // SetCommonQueryParamsFromStruct set URL query parameters from a struct using go-querystring |
| 521 | // for requests fired from the client. |
| 522 | func (c *Client) SetCommonQueryParamsFromStruct(v any) *Client { |
| 523 | values, err := query.Values(v) |
| 524 | if err != nil { |
| 525 | c.log.Warnf("failed to convert struct to query parameters: %v", err) |
| 526 | return c |
| 527 | } |
| 528 | return c.SetCommonQueryParamsFromValues(values) |
| 529 | } |
| 530 | |
| 531 | // SetCommonCookies set HTTP cookies for requests fired from the client. |
| 532 | func (c *Client) SetCommonCookies(cookies ...*http.Cookie) *Client { |