Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c6e3d98154
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (36 sloc) 1.081 kb
require 'net/http'
require 'uri'
require 'tempfile'
require 'active_support/core_ext'
require 'active_support/inflector'
$:.unshift(File.dirname(__FILE__))
require 'nestful/exceptions'
require 'nestful/formats'
require 'nestful/connection'
require 'nestful/request/callbacks'
require 'nestful/request'
require 'nestful/resource'
module Nestful
extend self
def get(url, options = {})
Request.new(url, ({:method => :get}).merge(options)).execute
end
def post(url, options = {})
Request.new(url, ({:method => :post, :format => :form}).merge(options)).execute
end
def put(url, options = {})
Request.new(url, ({:method => :put}).merge(options)).execute
end
def delete(url, options = {})
Request.new(url, ({:method => :delete}).merge(options)).execute
end
def json_get(url, params = nil)
get(url, :format => :json, :params => params)
end
def json_post(url, params = nil)
post(url, :format => :json, :params => params)
end
def json_put(url, options = {})
put(url, {:format => :json}.merge(options))
end
end
Jump to Line
Something went wrong with that request. Please try again.