diff --git a/lib/httparty.rb b/lib/httparty.rb index 7525dab..8664cbf 100644 --- a/lib/httparty.rb +++ b/lib/httparty.rb @@ -184,18 +184,22 @@ module HTTParty perform_request Net::HTTP::Post, path, options end + # Perform a PUT request to a path def put(path, options={}) perform_request Net::HTTP::Put, path, options end + # Perform a DELETE request to a path def delete(path, options={}) perform_request Net::HTTP::Delete, path, options end + # Perform a HEAD request to a path def head(path, options={}) perform_request Net::HTTP::Head, path, options end + # Perform an OPTIONS request to a path def options(path, options={}) perform_request Net::HTTP::Options, path, options end diff --git a/lib/httparty/exceptions.rb b/lib/httparty/exceptions.rb index 73ce4ea..512aec7 100644 --- a/lib/httparty/exceptions.rb +++ b/lib/httparty/exceptions.rb @@ -9,7 +9,8 @@ module HTTParty # response object accessible via the {#response} method. class ResponseError < StandardError # Returns the response of the last request - # @return [Net::HTTPResponse] + # @return [Net::HTTPResponse] A subclass of Net::HTTPResponse, e.g. + # Net::HTTPOK attr_reader :response # Instantiate an instance of ResponseError with a Net::HTTPResponse object diff --git a/lib/httparty/parser.rb b/lib/httparty/parser.rb index fb5a3a4..68be2ae 100644 --- a/lib/httparty/parser.rb +++ b/lib/httparty/parser.rb @@ -58,7 +58,7 @@ module HTTParty # @return [Symbol] e.g. :json attr_reader :format - # Instantiate the parser and call #parse. + # Instantiate the parser and call {#parse}. # @param [String] body the response body # @param [Symbol] format the response format # @return parsed response