mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Added explicit html format option.
This commit is contained in:
parent
99a07b58c2
commit
e0cb4311d9
2 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ require 'pp'
|
||||||
|
|
||||||
class Google
|
class Google
|
||||||
include HTTParty
|
include HTTParty
|
||||||
|
format :html
|
||||||
end
|
end
|
||||||
|
|
||||||
# google.com redirects to www.google.com so this is live test for redirection
|
# google.com redirects to www.google.com so this is live test for redirection
|
||||||
|
|
|
@ -14,7 +14,7 @@ module HTTParty
|
||||||
class UnsupportedFormat < StandardError; end
|
class UnsupportedFormat < StandardError; end
|
||||||
class RedirectionTooDeep < StandardError; end
|
class RedirectionTooDeep < StandardError; end
|
||||||
|
|
||||||
AllowedFormats = {:xml => 'text/xml', :json => 'application/json'}
|
AllowedFormats = {:xml => 'text/xml', :json => 'application/json', :html => 'text/html'}
|
||||||
|
|
||||||
def self.included(base)
|
def self.included(base)
|
||||||
base.extend ClassMethods
|
base.extend ClassMethods
|
||||||
|
|
Loading…
Add table
Reference in a new issue