Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Move Authenticator to RestRequest #91

Open
adamhathcock opened this issue Nov 11, 2016 · 4 comments
Open

Move Authenticator to RestRequest #91

adamhathcock opened this issue Nov 11, 2016 · 4 comments
Milestone

Comments

@adamhathcock
Copy link

Would it make more sense to have Authenticator on the RestRequest? I could then reuse clients across different usages of authentication.

@fubar-coder
Copy link
Contributor

The only thing that might make sense is to be able to override the authenticator for a single request and otherwise using the one in IRestClient. What's the reason why you want to avoid multiple IRestClient instances?

@adamhathcock
Copy link
Author

Basically this: http://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/

Basically, I have a web server that's talking to a REST API. The web server passes creds on to the API. Managing the RestClient per scope is what I'm doing.

I guess I could make a custom client factory that's static basically then just make tons of RestClient instances.

Is that what you suggest?

@fubar-coder
Copy link
Contributor

I usually suggest a IRestClient per base URL, because that's the common usage scenario where you have a base URL and access only paths relative to this base URL. Your use case is quite uncommon, but it's valid. I should create a V4.1 for this.

@fubar-coder fubar-coder added this to the 4.1.0 milestone Nov 11, 2016
@adamhathcock
Copy link
Author

Yeah, making a RestClient per base URL is what I was attempting to do.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants