Hi Again:
I posted a problem that I'm having with Webrequests earlier.
I ran a packet sniffer to find out what the .NET environment was sending as opposed to the IE Web Browser.
I found that .NET had left out a bunch of headers (though they didn't look necessary) so I added them.
No help . . .
I noticed that IE sends the entire request (headers + a blank line + the request) in one transmission.
The .NET environment sends an:
Expect: 100-continue
header and then waits for a response from the server which it does get:
HTTP/1**UnReg**ntinue
Then it sends the request:
userna**UnReg**&user_password=Tester&redirect=&mod e=&f=&t=&op=login&submit=Login
This is the only real significant difference I found between IE and the .NET environment.
QUESTION: How can I stop the Webrequest object from sending the
Expect: 100-continue
header????? and make it send the blank line + request in the same transmission?????
For your curiosity, I've posted both the IE and the .NET request communications below (as retrieved by the packet sniffer).
You'll have to decipher what was sent and what was retrieved.
Internet Explorer:
---------------------------------------------------------------------
POST /**UnReg**hp?name=Your_Account HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer:
http://www.365articles.com/modules.p...e=Your_Account
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host:
www.365articles.com
Content-Length: 68
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: lang=english
username=MAtkins&user_password=geneva&redirect=&mo de=&f=&t=&op=login
POST /**UnReg**hp?name=Your_Account HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer:
http://www.365articles.com/modules.p...e=Your_Account
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host:
www.365articles.com
Content-Length: 68
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: lang=english
username=MAtkins&user_password=geneva&redirect=&mo de=&f=&t=&op=login
HTTP/1**UnReg**ate: Tue, 25 Oct 2005 07:39:01 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
Content-Encoding: gzip
Vary: Accept-Encoding
X-Powered-By: PHP/4.3.10
Location: modules.php?name=Your_Account&stop=1
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
GET /m**UnReg**p?name=Your_Account&stop=1 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer:
http://www.365articles.com/modules.p...e=Your_Account
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host:
www.365articles.com
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: lang=english
GET /m**UnReg**p?name=Your_Account&stop=1 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer:
http://www.365articles.com/modules.p...e=Your_Account
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host:
www.365articles.com
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: lang=english
---------------------------------------------------------------------
.NET Environment:
---------------------------------------------------------------------
post /**UnReg**hp?name=Your_Account HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: lang=english; expires=Wed, 25-Oct-06 07:52:58 GMT
Content-Length: 80
Expect: 100-continue
Connection: Close
Host:
www.365articles.com
post /**UnReg**hp?name=Your_Account HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: lang=english; expires=Wed, 25-Oct-06 07:52:58 GMT
Content-Length: 80
Expect: 100-continue
Connection: Close
Host:
www.365articles.com
HTTP/1**UnReg**ntinue
userna**UnReg**&user_password=Tester&redirect=&mod e=&f=&t=&op=login&submit=Login
----------------------------------------------------------------------