MCPcopy Index your code
hub / github.com/imroc/req / SetCommonQueryParamsFromStruct

Method SetCommonQueryParamsFromStruct

client.go:522–529  ·  view source on GitHub ↗

SetCommonQueryParamsFromStruct set URL query parameters from a struct using go-querystring for requests fired from the client.

(v any)

Source from the content-addressed store, hash-verified

520// SetCommonQueryParamsFromStruct set URL query parameters from a struct using go-querystring
521// for requests fired from the client.
522func (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.
532func (c *Client) SetCommonCookies(cookies ...*http.Cookie) *Client {

Calls 2

WarnfMethod · 0.65

Tested by 1