-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use with oauth2 #89
Comments
I'm working on it. Let you know once done. Thanks. |
Please give it try and share your feedback then I will merge it to master. For example: // Create oauth client
// ...
oauthClient := conf.Client(ctx, token)
// Create resty client
restyClient := resty.New()
// http://godoc.org/golang.org/x/oauth2 implements `httpRoundTripper` interface
// Set the oauthClient transport
restyClient.SetTransport(oauthClient.Transport)
// Now you can use resty :) |
Solved by #91 |
Tested and it works beautifully. Thanks and awesome job, really loving resty!!!! |
I'm very glad, thank you for your appreciation. For this enhancement I gave only final touch. Credit goes to @bak1an for the PR. |
This does not work because I'm on the v0 branch. |
@arekkas please use v1 or master (edge) for this feature. It is recently added. Thank you. Can you please explain? What is the issue you're facing with retry? http.Client does not provide retry option; resty provides backoff mechanism and conditional option too. |
That was a quick response, awesome! :) I see, then I'll upgrade to v1. I think using |
@arekkas you're welcome. |
I started playing around with resty and liking it so far.
I am talking to a REST API that uses oauth2 and up until now using net/http and golang/oauth2 worked but resty is much nicer.
My problem is refreshing the accessToken for oauth when it's expired. By using the oauth2.Client it's very simple but unfortunately setting the http.Client is not possible in resty.
So, 2 questions:
The text was updated successfully, but these errors were encountered: