But the most important piece I needed to know in order to write an Atom server inside Perl’s CGI.pm was knowing how to read the rest of the data from a POST request. The XML doesn’t come as part of the form!

I had to actually read the CGI.pm sources to figure it out. And the solution is very simple, except that it’s not documented in the man page:

The system already knows how to handle POST (for new pages), GET (to read existing pages), there’s an Atom feed (but not yet as flexible as the existing RSS 2.0 feed). So, there’s PUT to implement for updating pages, and testing to do. I’m testing my extension using the XML::Atom::Client library. Having this kind of unit test really helps! Once you have the infrastructure set up, haha. I can’t believe it took me so long to figure out the POSTDATA thing. And looking back it seems incomprehensible to try and develop for Flock directly without the XML::Atom::Client library to write unit tests.

Update: Hah. Time passes. Little Alex wants to write the code that accepts PUT requests. And finds that no data is being read. How’s that? Correct, the stupid POSTDATA hack only works when looking at a POST request. D’oh!