1

I am trying to create a multi/form-data Postback using System.Net.HttpWebRequests.

Normally the browser creates the multi/form-data Postback. However, since I am using HttpWebRequests, I will have to parse the Html and then create a POST body based on the Html.

The controls on the page are updated frequently so I can't rely on hard coding the data for each control that should be posted. Instead I'll have to make a list of all the controls which should be posted and then do something like this.

But to do that I need to know how browsers determine which controls to include in the Postback body. So how do they?

Community
  • 1
  • 1

2 Answers2

1

I found my answer on W3C's website.

0

Browser's submit behavior is to send content of all controls (like <input> elements) inside <form> element that is being submitted.

Usage of this behavior on pages is low due to heavy reliance on AJAX post backs for pages. AJAX requests are constructed by script code and are essentially not restricted anything.

Complete list of "form controls" can be found in the Forms in HTML documents specification.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
  • I'm pretty sure it's not just seeing as the Postback includes –  Mar 14 '12 at 21:18
  • Updated - input, select, textarea (and could be button, I'm not sure). – Alexei Levenkov Mar 14 '12 at 22:41
  • Yes everyone has a vague idea of what it should include but I would like a more concrete definition. I also know elements should be included. –  Mar 15 '12 at 21:23