Welcome to the "trac"-ing site of http-access2!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #222 (new enhancement)

Opened 1 year ago

Last modified 10 months ago

post_content: returning full header

Reported by: user Assigned to: nahi
Priority: normal Milestone: 2.1.6
Component: core Version: 2.0
Keywords: Cc:

Description

This is about the HTTPClient#follow_redirect / HTTPClient#post_content methods.

It seems it is not standard browser behaviour to follow redirects returned for POST requests, and post the same message to the new location. However, for what I use this library for, it is useful. The post_content method reads at revision 280:

def post_content(uri, body = nil, extheader = {}, &block)
  follow_redirect(:post, uri, nil, body, extheader, &block).content
end

The follow_redirect method is marked as private.

Since the post_content only returns the content, the content-type, and other header entries are not available.

An easy solution would be to add a method that does the same as post_content, but returns the return value of follow_redirect ?

def post_with_redirect(uri, body = nil, extheader = {}, &block)
  follow_redirect(:post, uri, nil, body, extheader, &block)
end

I think this is related to http://dev.ctor.org/http-access2/ticket/208 (although I haven't seen such problems)

Change History

06/25/09 08:09:22 changed by user

  • type changed from defect to enhancement.

10/29/09 18:42:08 changed by nahi

  • milestone changed from undefined to 2.1.6.