kenakamu / UCWA2.0-CS

C# library for UCWA 2.0
MIT License
24 stars 13 forks source link

Issue with version 2 requests #54

Open StefanSiebert opened 6 years ago

StefanSiebert commented 6 years ago

Hello,

starting with version 1.0.7, http client caching was added and the default version string has changed from empty to 2.0 This will bring up the following exception for version 2 requests like adding a contact to a group (AddContactToGroup).

Microsoft.Skype.UCWA.Models.MethodNotAllowedException: The request isn't supported. at async Task Microsoft.Skype.UCWA.Services.HttpService.HandleError(HttpResponseMessage response) at async Task Microsoft.Skype.UCWA.Services.HttpService.ExecuteHttpCallAndRetry(Func<CancellationToken, Task> httpRequest, Func<HttpResponseMessage, T> deserializationHandler, CancellationToken cancellationToken) at async Task Microsoft.Skype.UCWA.Services.HttpService.Post(string uri, object body, CancellationToken cancellationToken, string version, bool anonymous) at async Task Microsoft.Skype.UCWA.UCWAClient.AddContactToGroup(string sip, string groupId, CancellationToken cancellationToken)

I have found out that the version string 2.0 has to be changed to 2 or it will be ignored. However, version 1 requests won't work then. Changing the version back to an empty string and splitting the client caching also by version fixed the problem for me.

Thanks,

Stefan

kenakamu commented 6 years ago

Great. Could you craft PR for this one, please?