Updating an Atom Entry
To update an Atom entry, it is recommended that clients first retrieve a complete representation of that entry, as it is not guaranteed that an <entry> element contained within an Atom feed will have all the information about that entry (see retrieving an Atom Entry).
Once you have retrieved the Atom entry you are free to modify the elements that need to be updated. When you are finished, you post your changes back to the Atom service from which the entry was retrieved via an authenticated HTTP PUT operation.
If the operation is successful, the Atom server will return an HTTP status code of 200, and a copy of the entry that was updated. For many clients, the HTTP status code is enough. But for some clients the Atom entry returned in the response can be helpful if the client needs to record the server's "last updated" timestamp for the entry, or to inspect any other server generated meta data associated with the entry.

Comments
I see:
Error on PUT http://mydomain.com/mt/mt-atom.cgi/1.0/blogid=98/entryid=9724: 500 Can't call method "body" on an undefined value at lib/MT/AtomServer.pm line 654.
my $res = $api->updateEntry($EditURI, $entry); unless (defined $res) { print $api->errstr, “\n”; exit; }
Posted by: Rob Staveley
|
August 27, 2009 6:09 AM
…Oops hit “Post” prematurely…
That’s with: Movable Type Enterprise version 4.23-en.
The relevant code in ./lib/MT/AtomServer.pm is:
$entry->text(encodetext(MT::I18N::utf8off($atom->content()->body()),’utf-8’,$enc));
That suggests that $atom-content() is undefined.
I’m setting content in the client per http://search.cpan.org/dist/XML-Atom-0.23/lib/XML/Atom/Entry.pm though.
I was wondering if this is a known issue?
Posted by: Rob Staveley
|
August 27, 2009 6:16 AM