| | | dhtml |  |
| Posted: Thu Aug 07, 2008 7:50 pm Post subject: Designing a Form Serializer |  |
Who decides the boundary in a multipart/form-data request?
An Form Serializer builds a string out of the successful HTML Form controls. The string will be passed to an AsyncRequest adapter for XMLHttpRequest.send( data )
Form::getMultipartFormData::string[] AsyncRequest::send( data::string );
The multipart-form/data is where I am having difficulty. A boundary separates field data in the request body. The boundary exists in two places: The data and the HTTP header request.
I want to keep the two decoupled.
Where should the boundary get created: Form or AsyncRequest?
1) AsyncRequest::send: will have to do some extra work joining form data on the boundary. 2) Form::getMultipartFormDataString will have to provide some way for the boundary to be obtained.
Where should the boundary get created? The AsyncRequest::send, or the Form::getMultipartFormDataString?
Garrett |
|