Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 25th, 2005, 03:46 AM
Authorized User
 
Join Date: Aug 2003
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default Experts?? Problem w/ Webrequest

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
----------------------------------------------------------------------

__________________
http://www.softlinksys.com
Professional Software Developer since 1994.
 
Old October 25th, 2005, 03:52 AM
Authorized User
 
Join Date: Aug 2003
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I forgot to mention that I have set:
webrequest.KeepAlive = true;

Still, if you notice, it sets the Connection header to:
Connection: Close

IE sets the Connection to:
Connection: Keep-Alive

I think this is what's making .NET send the:
  Expect: 100-continue
header but I can't seem to control it.

Any real help would be greatly appreciated.

 
Old April 9th, 2006, 10:21 PM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any luck with this problem? I'm stumped on it too.






Similar Threads
Thread Thread Starter Forum Replies Last Post
WebRequest/WebResponse form submit problem. HELP! MAtkins ASP.NET 1.0 and 1.1 Professional 2 December 23rd, 2010 12:28 AM
problem with using WebRequest class in C# anilkumarbv General .NET 0 December 28th, 2004 02:23 AM
Any xlink experts out there? mountainbiker XML 3 February 29th, 2004 01:49 PM
Help, any javascript experts! tanmaylian Javascript 1 January 21st, 2004 04:59 AM
How do I.....? One for the Experts!? ziwez0 Access VBA 13 October 20th, 2003 05:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.