c# - An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set -


i trying content web page using code :

httpclient http = new httpclient();   var response = await http.getbytearrayasync("www.nsfund.ir/news?p_p_id=56_instance_tvzmolp4zfgh&_56_instance_tvzmolp4zfgh_mode=news&_56_instance_tvzmolp4zfgh_newsid=3135919&p_p_state=maximized");    string source = encoding.getencoding("utf-8").getstring(response, 0, response.length - 1);    source = webutility.htmldecode(source);    htmldocument resultat = new htmldocument();    resultat.loadhtml(source); 

but error :

an invalid request uri provided. request uri must either absolute uri or baseaddress must set.

you need specify full url ( including protocol) this:

var response = await http.getbytearrayasync("http://www.nsfund.ir/news?p_.... 

Comments

Post a Comment

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -