-
Notifications
You must be signed in to change notification settings - Fork 71
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 HttpClient instead of HttpWebRequest #22
Comments
Work in progress, but now blocked in make globalized HttpClient and cookieContainer, because I am not a C# expert. See yfdyh000@6ca9537. New efforts are underway. |
https://github.com/yfdyh000/TumblThree/tree/httpClient-wip1 (still going on locally) |
Thanks for your work! |
Thank you for your answer. I have suspended work on it. |
Let me know, also later, if you like to resume. If not, it's understandable. |
The code is full with error prone exception handling caused by the
HttpWebRequest
api. Additionally the async variant of theGetReposone
method,GetResponseAsync()
is broken as it never timeouts if the underlying connection drops and lead me to implement the TaskTimeout Extension.From the MSDN docs (the GetResponeAsync() method uses BeginGetResponse() internally (thanks for not telling MS!)):
The newer interface HttpClient was designed with async in mind and should be used instead. It also doesn't use Exceptions to handle non-successful web responses (i.e. status codes 300-499).
See also these issues for more: TumblThree/#116, TumblThree/#214.
The text was updated successfully, but these errors were encountered: