module HTTParty::ClassMethods
def format(f = nil)
format :json
include HTTParty
class Foo
Must be one of the allowed formats ie: json, xml
Allows setting the format with which to parse.
def format(f = nil) if f.nil? default_options[:format] else parser(Parser) if parser.nil? default_options[:format] = f validate_format end end