httpwebresponse / request not sending proper headers?

  • Thread starter Thread starter Piotrekk
  • Start date Start date
P

Piotrekk

Hi
I have the following code:
request = (HttpWebRequest)WebRequest.Create(FullPath);
request.Headers.Clear();
request.ProtocolVersion = HttpVersion.Version11;



response = (HttpWebResponse)request.GetResponse();

FullPath variable contains the following filename:
Constitution and real life – comparison.ppt

When i sniff my ports ( ethereal ) i follow the stream to see the
following:
GET
/filemanager/api.php?cmd=get&PHPSESSID=5609e75335611d0d552bd42bc1a1be7e&f=other%2fConstitution%20and%20real%20life%20&
HTTP/1.1

The part of the FullPath after '&' character is missing. I would be
gratefull for help.
PK
 
If you want to transmit the ampersand and *not* have it interpreted as a
querystring delimiter (e.g., &name=value&name2=value2 )
then it needs to be HtmlEncoded / UrlEncoded. Look up the HtmlEncode and
UrlEncode methods for more details.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top