Dab tsi yog lub sijhawm ncua sijhawm rau Httpclient C#?
Dab tsi yog lub sijhawm ncua sijhawm rau Httpclient C#?

Video: Dab tsi yog lub sijhawm ncua sijhawm rau Httpclient C#?

Video: Dab tsi yog lub sijhawm ncua sijhawm rau Httpclient C#?
Video: [HD] Kristine Xiong Lub Sijhawm with Lyrics 2024, Kaum ib hlis
Anonim

Lub sijhawm ncua sijhawm ntawm HttpClient yog 100 vib nas this.

Ua raws li qhov no saib, lub sijhawm ncua sijhawm rau HTTP thov yog dab tsi?

120 vib nas this

Kuj Paub, HttpClient timeout yog dab tsi? Cov HttpClient los ntawm System. Net. Http pob muaj Sijhawm cov cuab yeej uas defaults mus rau 100 vib nas this uas raws li kuv nyeem los ntawm cov cai tsuas yog txhais tau tias ntev npaum li cas kom txog thaum txoj haujlwm raug muab tshem tawm. Yog tias koj muaj kev ua haujlwm uas siv sijhawm 40 vib nas this ua ntej nws rov qab cov ntaub ntawv nws yuav ib txwm sij hawm tom qab 30 vib nas this.

Ntawm no, kuv yuav teem sijhawm HttpClient li cas?

Cov ua ntej tus nqi yog 100,000 milliseconds (100 vib nas this). Rau teeb ib infinite sij hawm , teeb tus nqi vaj tse rau InfiniteTimeSpan. Cov lus nug ntawm Lub Npe Lub Npe (DNS) yuav siv sijhawm li 15 vib nas this kom rov qab los lossis sijhawm tawm.

Kuv puas yuav muab

Yog li, yog tias koj tab tom tsim ib qho HttpRequestMessage thiab xa cov lus ntawd mus rau SendAsync txoj kev ntawm System. Yog tias koj siv, hais, StringContent, nws tsis tas yuav muab pov tseg lawm thiab yog li cov lus tsis tas yuav muab pov tseg.

Pom zoo: