Sha256: d273d606ca50ef7b5f54b391675d3f80cd4ecbe4c17ba7d0bbf0a1289fe9b81f
Contents?: true
Size: 872 Bytes
Versions: 57
Compression:
Stored size: 872 Bytes
Contents
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) require File.join(dir, 'httparty') require 'pp' # You can also use post, put, delete, head, options in the same fashion response = HTTParty.get('http://twitter.com/statuses/public_timeline.json') puts response.body, response.code, response.message, response.headers.inspect 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)
Version data entries
57 entries across 57 versions & 6 rubygems