Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / December 2007

Tip: Looking for answers? Try searching our database.

HttpWebRequest POST with headers and DATA in same network package

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
martinwlarsen@hotmail.com - 07 Oct 2004 21:55 GMT
I’m making a class to POST something on a web page that needs the headers and
data to be in the same package. I have tried the following but nothing
helps(I always get a packet with headers and one with data).

System.Net.ServicePointManager.Expect100Continue = false;
Request.AllowWriteStreamBuffering = false;            
Request.ContentType = "application/x-www-form-urlencoded";

According to the documentation about
system.Net.ServicePointManager.Expect100Continue  setting this to false
ensures that data and headers are send together,  but it does not work this
way.

Does anyone know a solution for this problem?

 BRGDS
   Martin W. Larsen
Joerg Jooss - 08 Oct 2004 18:30 GMT
> I'm making a class to POST something on a web page that needs the
> headers and data to be in the same package. I have tried the
[quoted text clipped - 11 lines]
>
> Does anyone know a solution for this problem?

There is no notion of packets in HTTP, just requests and responses. All
ServicePointManager.Expect100Continue does is add or suppress HTTP 1.1
Expect headers, so you either have one or two request/response pairs. How
many actual network packets are being sent depends on the underlying network
stack.

Cheers,

Signature

Joerg Jooss
www.joergjooss.de
news@joergjooss.de

Galan Bridgman [MVP-Digital Media] - 16 Nov 2004 21:30 GMT
Martin,

Try moving your Expect100Continue = false call up to before you open your
socket.  Not sure how soon this flag has to be set, but putting it before
the Create() works for me.  :)

Regards,
Galan Bridgman
Microsoft MVP - Windows XP Digital Media

> I'm making a class to POST something on a web page that needs the headers
and
> data to be in the same package. I have tried the following but nothing
> helps(I always get a packet with headers and one with data).
[quoted text clipped - 12 lines]
>   BRGDS
>     Martin W. Larsen
fieryMon - 04 Dec 2007 14:46 GMT
This worked really well for me.

'Galan Bridgman [MVP-Digital Media Wrote:
> ;3238534']Martin,
>
[quoted text clipped - 31 lines]
> >   BRGDS
> >     Martin W. Larsen

Signature

fieryMon


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.