You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to add custom headers per the request.
Describe the solution you'd like
Support options, then we could add options...Options for every method without breaking existing API
type Options func(*resty.Request)
// GetRequestWithBearerAuth returns a JSON base request configured with an auth token.
func (g *GoCloak) GetRequestWithBearerAuth(ctx context.Context, token string, options...Options) *resty.Request {
request := g.GetRequest(ctx).
SetAuthToken(token).
SetHeader("Content-Type", "application/json")
for _, option := range options {
option(request)
}
return request
}
// the API may look like this
func (g *GoCloak) Login(ctx context.Context, clientID, clientSecret, realm, username, password string, options...Options) (*JWT, error)
Describe alternatives you've considered
I know there is SetPreRequestHook existed in RestyClient, but it could not be set for a single specific request.
Additional context
I am willing to help.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to add custom headers per the request.
Describe the solution you'd like
Support
options
, then we could addoptions...Options
for every method without breaking existing APIDescribe alternatives you've considered
I know there is
SetPreRequestHook
existed in RestyClient, but it could not be set for a single specific request.Additional context
I am willing to help.
The text was updated successfully, but these errors were encountered: