HttpWebRequest request = (HttpWebRequest) webrequest.create (URL);
Request. Headers. ADD ("Authorization", (String) Newtonsoft.json. JsonConvert. Deserializeobject (token));
Request. ContentType = "Application/json";
Request. Referer = URL;
Request. Timeout = 30 * 1000;
Request. useragent = "mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;. NET CLR 2.0.50727;. NET CLR 3.0.04506.648;. NET CLR 3.0.4506.2152;. NET CLR 3.5.30729)";
Request. Method = "GET";
HttpWebResponse response = (httpwebresponse) request. GetResponse ();
resultstring = Response. Statuscode.tostring ();
Stream backstream = response. GetResponseStream ();
StreamReader sr = new StreamReader (Backstream, Encoding. GetEncoding ("UTF-8"));
result = Sr. ReadToEnd ();
Sr. Close ();
Backstream.close ();
Response. Close ();
Request. Abort ();
C # background sends a request to a URL