Reputation:
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?
Upvotes: 1
Views: 179
Reputation: 100547
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.
Upvotes: 0