Home > Net >  Interface to the runtime tip: the remote server returns an error: (403) has been banned. How do I ch
Interface to the runtime tip: the remote server returns an error: (403) has been banned. How do I ch

Time:11-26

 public string Get (string uri) 
{
//according to customer request uri structure first address
String serviceUrl=the string. Format (" {0}/{1} ", enclosing BaseUri, uri);
//create the Web access to like
HttpWebRequest myRequest=(HttpWebRequest) WebRequest. Create (serviceUrl);
//through the Web access object to obtain response content
HttpWebResponse myResponse=(HttpWebResponse) myRequest. The method GetResponse ();
//create StreamReader object through the response content flow, because StreamReader more advanced faster
StreamReader reader=new StreamReader (myResponse GetResponseStream (), Encoding, UTF8);
//string returnXml=HttpUtility. UrlDecode (reader. ReadToEnd ());//if a coding problem in this way
String returnXml=reader. ReadToEnd ();//use of StreamReader can be read from the response content
Reader. The Close ();
MyResponse. Close ();
Return returnXml;
}


CodePudding user response:

Access denied.
Do you want to check the interface permissions, or write access, and so on questions,
https://www.cnblogs.com/jiaoaozuoziji/p/7283322.html

CodePudding user response:

What to see there are verified, increase the user-agent try
HttpWebRequest myRequest=(HttpWebRequest) WebRequest. Create (serviceUrl);
myRequest. UserAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; The.net CLR 1.1.4322; The.net CLR 2.0.50727) ";

CodePudding user response:

reference 1st floor is nu month god reply:
access denied,
Do you want to check the interface permissions, or write access, and so on questions,
https://www.cnblogs.com/jiaoaozuoziji/p/7283322.html


Thanks to reply, the method is a bit complicated, haven't yet figured out why

CodePudding user response:

The
big watermelon a WuYiJin reference 2 floor? Response:
to see there are verified what, try increasing the user-agent
HttpWebRequest myRequest=(HttpWebRequest) WebRequest. Create (serviceUrl);
myRequest. UserAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; The.net CLR 1.1.4322; The.net CLR 2.0.50727) ";

Thank you, add is still the same problem,

CodePudding user response:

The
reference 4 floor qq_16630463 reply:
Quote: big watermelon a WuYiJin reference 2 floor? Response:

What to see there are verified, increase the user-agent try
HttpWebRequest myRequest=(HttpWebRequest) WebRequest. Create (serviceUrl);
myRequest. UserAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; The.net CLR 1.1.4322; The.net CLR 2.0.50727) ";

Thank you, is still the same problem, after adding

You can need not code, caught a Fiddler, use the browser to normal access has those values
  •  Tags:  
  • C#
  • Related