Method: Atom::Collection#post!
- Defined in:
- lib/atom/collection.rb
#post!(entry, slug = nil) ⇒ Object
POST an entry to the collection, with an optional slug
92 93 94 95 96 97 98 |
# File 'lib/atom/collection.rb', line 92 def post!(entry, slug = nil) raise "Cowardly refusing to POST a non-Atom::Entry" unless entry.is_a? Atom::Entry headers = {"Content-Type" => "application/atom+xml" } headers["Slug"] = slug if slug @http.post(@href, entry.to_s, headers) end |