first_page

Sending Data to the Server with AJAX

Note to self: the short answer to the (implied) question, in this title of this post, is: use application/x-www-form-urlencoded HTTP posts and then slowly migrate over to Web Services when the schema-based formalism is needed.

What’s really great is that my sudden realization of the possibility of using ASPX pages as REST service endpoints. A strongly-typed request bag can be defined to quickly collect data and send it to a database. One could have an ASP.NET web application without a user interface. This realization overlooks all the hard work Scott Guthrie and his team put into ASP.NET 2.0—but then again Atlas may have something to say about this…

References

TitleNote
“[Forms in HTML Documents](http://www.w3.org/TR/REC-html40/interact/forms.html)”Formally defines the bread and butter of REST remote procedure calls—namely “form content types” especially the all-important `application/x-www-form-urlencoded` type.
“[AJAX Form POST Request—HTML Form POST/Submit with AJAX/Javascript Example/Tutorial](http://www.captain.at/howto-ajax-form-post-request.php)”This tutorial inspired me to link to the first item in this table.
“[Call SOAP Web services with AJAX, Part 1](http://www-128.ibm.com/developerworks/web/library/ws-wsajax/)”IBM of course would plug SOAP—because this means Java.
“[Async Requests over an Unreliable Network](http://ajaxblog.com/archives/2005/06/01/async-requests-over-an-unreliable-network)”“The biggest void in the discussion, IMO, is how network and server availability affects XMLHttpRequests.” And of course we must prepare for when the network is down.
“[XMLHttpRequest Call](http://www.ajaxpatterns.org/XMLHttpRequest_Call)”The “Handling POSTs and Other Request Types” section makes sense here…

rasx()