Permalink
Browse files

adding a basic post example

  • Loading branch information...
1 parent 822792c commit d4e5077001f1ce4eb3aa6fc7d71db6a8ce207200 pbuckley committed with sandro Dec 23, 2010
Showing with 21 additions and 0 deletions.
  1. +21 −0 examples/basic.rb
View
@@ -9,3 +9,24 @@
response.each do |item|
puts item['user']['screen_name']
end
+
+# An example post to a minimal rails app in the development environment
+# Note that "skip_before_filter :verify_authenticity_token" must be set in the
+# "pears" controller for this example
+
+class Partay
+ include HTTParty
+ base_uri 'http://localhost:3000'
+end
+
+options = {
+ :body => {
+ :pear => { # your resource
+ :foo => '123', # your columns/data
+ :bar => 'second',
+ :baz => 'last thing'
+ }
+ }
+}
+
+pp Partay.post('/pears.xml', options)

0 comments on commit d4e5077

Please sign in to comment.