Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OpenWrite() [4/4]

Stream System.Net.WebClient.OpenWrite ( Uri address,
string? method )
inline

Definition at line 602 of file WebClient.cs.

603 {
604 ArgumentNullException.ThrowIfNull(address, "address");
605 if (method == null)
606 {
607 method = MapToDefaultMethod(address);
608 }
609 WebRequest webRequest = null;
611 try
612 {
613 _method = method;
614 webRequest = (_webRequest = GetWebRequest(GetUri(address)));
615 return new WebClientWriteStream(webRequest.GetRequestStream(), webRequest, this);
616 }
617 catch (Exception ex) when (!(ex is OutOfMemoryException))
618 {
619 AbortRequest(webRequest);
620 if (ex is WebException || ex is SecurityException)
621 {
622 throw;
623 }
624 throw new WebException(System.SR.net_webclient, ex);
625 }
626 finally
627 {
628 EndOperation();
629 }
630 }
Uri GetUri(string address)
Definition WebClient.cs:990
virtual WebRequest GetWebRequest(Uri address)
Definition WebClient.cs:428
WebRequest _webRequest
Definition WebClient.cs:76
string MapToDefaultMethod(Uri address)
static void AbortRequest(WebRequest request)
Definition WebClient.cs:929
static string net_webclient
Definition SR.cs:14
Definition SR.cs:7

References System.Net.WebClient._method, System.Net.WebClient._webRequest, System.Net.WebClient.AbortRequest(), System.Net.WebClient.EndOperation(), System.Net.WebRequest.GetRequestStream(), System.Net.WebClient.GetUri(), System.Net.WebClient.GetWebRequest(), System.Net.WebClient.MapToDefaultMethod(), System.SR.net_webclient, System.Net.WebClient.StartOperation(), and System.ArgumentNullException.ThrowIfNull().