This PR aims to fix #78 and fix #85,
both highlighting a JsonReaderException happening in HttpAuthorizer.Authorize():
JsonReaderException: Unexpected character encountered while parsing value: S. Path '', line 0, position 0
where response.Content.ToString()
returns a System.Net.Http.StreamContent instead of the expected String.
This is fixed by utilizing ReadAsStringAsync() to serialize the HTTP content to a string as an asynchronous operation followed by a .Result which waits for the operation to complete and fetches the String with the HTTP content from the returned task object.
This PR aims to fix #78 and fix #85, both highlighting a JsonReaderException happening in
HttpAuthorizer.Authorize()
:where
response.Content.ToString()
returns aSystem.Net.Http.StreamContent
instead of the expectedString
.This is fixed by utilizing
ReadAsStringAsync()
to serialize the HTTP content to a string as an asynchronous operation followed by a.Result
which waits for the operation to complete and fetches theString
with the HTTP content from the returned task object.