Americas

  • United States

Form-less data submission on the Web

Opinion
Mar 31, 20032 mins
Enterprise Applications

A Web site I visited included pages that submitted information to the Web server without using a fill-out form or rewriting the page after the submission. How does that work? I thought Web data submissions always generated a server response.

A Web site I visited included pages that submitted information to the Web server without using a fill-out form or rewriting the page after the submission. How does that work?

The secret is in the variety of Web server responses that the HTTP specification defines.

The HTTP protocol includes a no-content response that allows input without changing the current document view. After receiving and interpreting a request message, a Web server responds with an HTTP response message.

The first line consists of the protocol version followed by a numeric status code and its associated textual phrase, with each element separated by space characters. The status code is a three-digit number in which the first digit identifies the class of response and the remaining digits identify the particular response.

The no-content status code is 204. This tells the browser that the submission was successful but not to change its document view, although any new or updated meta-information should be applied to the document. The 204 response does not include a message body and is always terminated by the first empty line after the HTTP response header fields.