WithQuery returns a RequestOption that sets the query value to the associated key. It overwrites any value if there was one already present.
(key, value string)
| 137 | // WithQuery returns a RequestOption that sets the query value to the associated key. It overwrites |
| 138 | // any value if there was one already present. |
| 139 | func WithQuery(key, value string) RequestOption { |
| 140 | return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error { |
| 141 | query := r.Request.URL.Query() |
| 142 | query.Set(key, value) |
| 143 | r.Request.URL.RawQuery = query.Encode() |
| 144 | return nil |
| 145 | }) |
| 146 | } |
| 147 | |
| 148 | // WithQueryAdd returns a RequestOption that adds the query value to the associated key. It appends |
| 149 | // onto any existing values. |
no test coverage detected
searching dependent graphs…