mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Add HTTParty::resend_on_redirect
This commit is contained in:
parent
f8a5234f54
commit
f902a7fcf3
1 changed files with 18 additions and 0 deletions
|
@ -294,6 +294,24 @@ module HTTParty
|
|||
default_options[:maintain_method_across_redirects] = value
|
||||
end
|
||||
|
||||
# Declare that you wish to resend the full HTTP request across redirects,
|
||||
# even on redirects that should logically become GET requests.
|
||||
# A 303 redirect in HTTP signifies that the redirected url should normally
|
||||
# retrieved using a GET request, for instance, it is the output of a previous
|
||||
# POST. maintain_method_across_redirects respects this behavior, but you
|
||||
# can force HTTParty to resend_on_redirect even on 303 responses.
|
||||
#
|
||||
# @example
|
||||
# class Foo
|
||||
# include HTTParty
|
||||
# base_uri 'http://google.com'
|
||||
# resend_on_redirect
|
||||
# end
|
||||
|
||||
def resend_on_redirect(value = true)
|
||||
default_options[:resend_on_redirect] = value
|
||||
end
|
||||
|
||||
# Allows setting a PEM file to be used
|
||||
#
|
||||
# class Foo
|
||||
|
|
Loading…
Reference in a new issue