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

◆ CopyHeadersTo()

void System.Net.WebClient.CopyHeadersTo ( WebRequest request)
inlineprivate

Definition at line 940 of file WebClient.cs.

941 {
942 if (_headers != null && request is HttpWebRequest httpWebRequest)
943 {
944 string text = _headers["Accept"];
945 string text2 = _headers["Connection"];
946 string text3 = _headers["Content-Type"];
947 string text4 = _headers["Expect"];
948 string text5 = _headers["Referer"];
949 string text6 = _headers["User-Agent"];
950 string text7 = _headers["Host"];
951 _headers.Remove("Accept");
952 _headers.Remove("Connection");
953 _headers.Remove("Content-Type");
954 _headers.Remove("Expect");
955 _headers.Remove("Referer");
956 _headers.Remove("User-Agent");
957 _headers.Remove("Host");
958 request.Headers = _headers;
959 if (!string.IsNullOrEmpty(text))
960 {
961 httpWebRequest.Accept = text;
962 }
963 if (!string.IsNullOrEmpty(text2))
964 {
965 httpWebRequest.Connection = text2;
966 }
967 if (!string.IsNullOrEmpty(text3))
968 {
969 httpWebRequest.ContentType = text3;
970 }
971 if (!string.IsNullOrEmpty(text4))
972 {
973 httpWebRequest.Expect = text4;
974 }
975 if (!string.IsNullOrEmpty(text5))
976 {
977 httpWebRequest.Referer = text5;
978 }
979 if (!string.IsNullOrEmpty(text6))
980 {
981 httpWebRequest.UserAgent = text6;
982 }
983 if (!string.IsNullOrEmpty(text7))
984 {
985 httpWebRequest.Host = text7;
986 }
987 }
988 }
WebHeaderCollection _headers
Definition WebClient.cs:70
void Remove(HttpRequestHeader header)

References System.Net.WebClient._headers, System.Net.WebHeaderCollection.Remove(), and System.text.

Referenced by System.Net.WebClient.GetWebRequest().