Skip to content
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

Unable to Set UserAgent : Request GetRequestTokenAuthorizeUrl & RetrieveAndStoreAccess #367

Open
manhao-chen opened this Issue Dec 23, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@manhao-chen
Copy link

manhao-chen commented Dec 23, 2018

hi team,

could we have a property exposed for setting the UserAgent when calling GetRequestTokenAuthorizeUrl and RetrieveAndStoreAccess

i see OAuthTokens.GetToken it appears to have it hard coded as

https://github.com/XeroAPI/Xero-Net/blob/master/Xero.Api/Infrastructure/OAuth/OAuthTokens.cs#L71

var req = new HttpClient(baseUri)
{
UserAgent = "Xero Api wrapper - " + consumer.ConsumerKey
};

could we have it like how the HttpClient.CreateRequest does it?

request.UserAgent = !string.IsNullOrWhiteSpace(UserAgent) ? UserAgent : "Xero Api wrapper - " + Consumer.ConsumerKey;

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.