By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,715 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,715 IT Pros & Developers. It's quick & easy.

Sending form headers to ASP.NET from HTTPWebRequest

P: n/a

[apologies for cross-posting this from the Dot.NET development group,
not sure which is more approriate]

Hi all, I'm having a strange problem where I need to build out form
variables in an HTTPWebRequest and send them to an aspx page for
processing. The page isn't recognizing the form variables at all, and
the only thing I can attribute it to is that when the call works, the
aspx page doesn't send a HTTP/1.1, Status Code = 100 response, i.e.
the calls go like this:

29 1109.853516 HTTP HTTP: Request, POST /
30 1109.853516 HTTP HTTP: HTTP Payload
where the form variables are contained within the initial Request

Body: ------------Ij5gL6ae0Ij5ei4gL6KM7ae0gL6Ij5
Body: Content-Disposition: form-data; name="projectId"
Body: 159
Body: ------------Ij5gL6ae0Ij5ei4gL6KM7ae0gL6Ij5
Body: Content-Disposition: form-data; name="sessionId"
Body: wq3zlprijum1q455wwv53kq2

This is done through a Test aspx page that was made just to make sure
that the server was working. The problem is that I need to send a file
to the same aspx page from a desktop app, which means I have to build
out the HTTPWebRequest myself. That I can do fine, but the server
always responds to the initial request:

257 24.547852 JNOBLE HTTP HTTP: Request, POST /
258 24.638672 JNOBLE HTTP HTTP: Response, HTTP/1.1, Status
Code = 100
259 24.639649 JNOBLE HTTP HTTP: HTTP Payload
and the form variables are always sent in the second payload, in this
case the frame marked 259. The response from the server is always:
"projectId = 0 is unknown", which means that the server isn't getting
those form variables from the inital request, and hence is simply
ignoring them. Anyone know how I can append the form variables to the
initial request, instead of writing it later in the request stream?
I'm thinking that might be the problem but I could be wrong? Any info
or ideas would be greatly appreciated. Thanks so much,

Feb 12 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.