Skip to content

Commit

Permalink
supporting follow by default
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Oct 24, 2010
1 parent 422a1d2 commit ad5156d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/restfulie/client/dsl.rb
Expand Up @@ -9,6 +9,7 @@ def initialize
request :setup_header
request :serialize_body
request :enhance_response
request :follow_request
end

def request(what)
Expand Down
1 change: 1 addition & 0 deletions lib/restfulie/client/feature/follow_request.rb
Expand Up @@ -14,6 +14,7 @@ def follow(code = nil)

def execute(flow, request, response, env)
resp = flow.continue(request, response, env)
debugger
if follow_codes.include?(resp.code.to_i)
location = resp.response.headers['location'] || resp.response.headers['Location']
raise Error::AutoFollowWithoutLocationError.new(request, resp) unless location
Expand Down
1 change: 0 additions & 1 deletion lib/restfulie/client/feature/serialize_body.rb
Expand Up @@ -6,7 +6,6 @@ def execute(flow, request, response, env)

payload = env[:body]
if payload && !(payload.kind_of?(String) && payload.empty?)
debugger
type = request.headers['Content-Type']
raise Restfulie::Common::Error::RestfulieError, "Missing content type related to the data to be submitted" unless type

Expand Down

0 comments on commit ad5156d

Please sign in to comment.