Things that work, things that don’t

HTTP GET requests with basic authentication: working.
HTTP POST requests with basic authentication: not working. But I can’t tell if this is because I’m doing it wrong, or because Blogger appears to be somewhere in the middle of switching to a generic Google data API, so I gave up and decided to write an Atom feed generator instead.

Which leads me to the next problem: the Time library documentation says there’s an xmlschema function, to generate iso8601 formatted date/time strings. But I can’t find it. Time.xmlschema gives me “undefined method `xmlschema’ for Time:Class”. returns “undefined method `xmlschema’ for Sun Sep 24 10:25:30 -0700 2006:Time”.

As a sidenote, irb is really handy for poking around in classes and testing ideas before writing several lines of code that may or may not work as expected. So I tried Time.methods, and sure enough I can’t find xmlschema at all.

What’s going on here? Am I using this wrong, or is the documentation out of sync with the library? Do I have to construct the date string I need by hand?

Ruby Cookbook to the rescue. I found a way to get the date string I need:

require 'date'

Tags: , ,

Comments are closed.