开发者

Illegal characters in path exception

I trying to get page from this url: YandexMarket

but WebClient and httpWebRequest throw exception

Illegal characters in path.

HttpUtility开发者_如何学C.UrlEncode doesnt work for this symbol "-".

Firefox and other browser are correctly open the page.

Here is my code:

public string GetPage(string url)
{
    var wReq = (HttpWebRequest)WebRequest.Create(url);
    return new StreamReader(wReq.GetResponse().GetResponseStream()).ReadToEnd();
}

How i can get the page?

Sorry guys. All ok.


The dash is not an character that needs escaping in urls. Are you sure it's dash or not other character that looks like it?

Take care that the browser does not display the actual url that is using but a "user friendly" form of it.

See http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜