Lunar
Lunar
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
😴
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
Is there anything else I need to change ?
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
try { CancellationTokenSource timeoutSource = null; if (x) { //For A request timeoutSource = new CancellationTokenSource(TimeSpan.FromSeconds(3)); } else if(y) { //For B request timeoutSource = new CancellationTokenSource(TimeSpan.FromSeconds(5)); } //Reset request will default var result = await client.GetAsync(url, timeoutSource.Token); }catch()
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
🙇🏿
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
Thank you
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
From where you have learn all this ?
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
hmm
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
like this
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
public async fun() { await work(); }
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
should I remove ?
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
To compute multiple request
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
await for result
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
It is for threading
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
means ? example plz
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
Then I can remove Timeout from HttpClientObject and student and then add this condition if(A) { CancellationTokenSource timeoutSource = new CancellationTokenSource(2000); var result = client .GetAsync("url",timeoutSource.Token).GetAwaiter().GetResult(); } else{ CancellationTokenSource timeoutSource = new CancellationTokenSource(default); var result = client .GetAsync("url",timeoutSource.Token).GetAwaiter().GetResult(); } }
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
like this ? CancellationTokenSource timeoutSource = new CancellationTokenSource(2000); await httpClient.GetAsync("http://www.foo.bar", timeoutSource.Token);
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
how this would help ?
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
something like that
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
A request - 10 s B request - default C request - deafult
107 replies
CC#
Created by Lunar on 5/29/2023 in #help
❔ HttpClient Error
yes, I think
107 replies