-
-
Notifications
You must be signed in to change notification settings - Fork 455
Move Old HttpWebRequest to HttpClient Instance #178
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
Conversation
Release 1.1.0 | Plugin 1.1.0 | Explorer Plugin 1.1.0
Release 1.1.1
Release 1.1.2
Release 1.2.0 | Plugin 1.2.0
Release 1.2.1
# Conflicts: # Flow.Launcher.Infrastructure/Http/Http.cs # Plugins/Flow.Launcher.Plugin.PluginManagement/Main.cs
… setting won't update automatically without action
…e doing Http request
|
Seems that Fody provides easy an injection for IPropertyChanged, which is included in Flow........but anyway, since I have written it, just leave it there..... |
… into UpdateHttpMaster
2. Manually replace "#" with "%23" to solve the similar issue in Explorer plugin 3. Add GetAsync method with Uri as argument 4. Remove unused encoding argument 5. Change exception type for WebSearch Plguin 6. Update Comment
…or await in checking update
|
|
||
| public static async Task Download([NotNull] string url, [NotNull] string filePath) | ||
| { | ||
| using var response = await client.GetAsync(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client.GetAsync crashes the entire app for me when i try to install plugin. Cant see any reason why though, no exception is thrown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me take a check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's because before the Http.Download is not async, so no await is added there.
Fix it, and the previous one. Forget to commit seperately, so both is on last commit. @jjw24 |
|
Hold on, update also call the method Http.Download so need to change that as well. |
|
|
|
Done, please review. @jjw24 |
| try | ||
| { | ||
| const string api = "http://suggestion.baidu.com/su?json=1&wd="; | ||
| result = await Http.Get(api + Uri.EscapeUriString(query), "GB2312"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removal of "GB2312" is intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have checked, the ReadAsString doesn't need the encoding to create the result.
|
good work |
|
for reference on why use ConfigureAwait(false) |


This pull request changes the Get & Download method implementation in Flow.Launcher.Infrastructure.Http by moving the old HttpWebRequest API to new HttpClient.
This has fixed my issue of connection to Github while checking for new Update.