mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Add a RKRequest attribute to control redirect handling
The default behavior is the same as before, to follow redirects. If RKRequest.followRedirect is set to NO, then a redirect (301, 302, 307) response will not be followed, and the request processing will proceed using the current request only.
This commit is contained in:
committed by
Blake Watters
parent
e0b248da46
commit
ea100b6aac
@@ -18,6 +18,7 @@ require 'restkit/network/authentication'
|
||||
require 'restkit/network/etags'
|
||||
require 'restkit/network/timeout'
|
||||
require 'restkit/network/oauth2'
|
||||
require 'restkit/network/redirection'
|
||||
|
||||
class Person < Struct.new(:name, :age)
|
||||
def to_json(*args)
|
||||
@@ -38,6 +39,7 @@ class RestKitTestServer < Sinatra::Base
|
||||
use RestKit::Network::ETags
|
||||
use RestKit::Network::Timeout
|
||||
use RestKit::Network::OAuth2
|
||||
use RestKit::Network::Redirection
|
||||
|
||||
def render_fixture(path, options = {})
|
||||
send_file File.join(settings.public_folder, path), options
|
||||
|
||||
Reference in New Issue
Block a user