Getting response from WebRequest throws Invalid URI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anacrisan
    New Member
    • Aug 2007
    • 6

    Getting response from WebRequest throws Invalid URI

    I have a strange problem with a WebRequest. It used to work just fine, but now I get an exception (Invalid URI: The hostname could not be parsed.) every time I try to get the response from that request.

    Stack Trace:

    Code:
       at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
       at System.Uri..ctor(String uriString)
       at System.Net.WebProxy.CreateProxyUri(String Address)
       at System.Net.WebProxy..ctor(String Address, Boolean BypassOnLocal)
       at System.Net.HttpWebRequest.SubmitRequest()
       at System.Net.HttpWebRequest.finishGetResponse()
       at System.Net.HttpWebRequest.GetResponse()
       at StockQuotes.Form1.listBox_SelectedIndexChanged(Object sender, EventArgs e)
       at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
    And the value for the uri is: http://quote.yahoo.com/d/quotes.csv?s=MS FT&f=l1n . Which works just fine if I point my browser to it.

    I appreciate any help.
Working...