Bug #655
closedQuery part lost when using Net::HTTP.post_form function
Description
=begin
when posting data by following code:
require 'net/http'
require 'uri'
response = Net::HTTP.post_form URI.parse('http://localhost/api.asp?Action=Check'), {'name'=>'value'}
puts response.body
query part ("Action=Check" in this case) are not attached.
server side receive a request /api.asp without query.
problem could be solved by simple change post_form code:
req = Post.new(url.path)
to
req = Post.new(url.request_uri)
i'm not sure it is a bug or i mis-understand, if i do, is there anyway to post form with query, for i need to deal with some Third Part API.
=end
Updated by shyouhei (Shyouhei Urabe) almost 16 years ago
- Assignee set to aamine (Minero Aoki)
=begin
=end
Updated by nahi (Hiroshi Nakamura) about 14 years ago
- Category set to lib
- Assignee changed from aamine (Minero Aoki) to nahi (Hiroshi Nakamura)
- ruby -v set to should be the latest at that time
=begin
=end
Updated by shyouhei (Shyouhei Urabe) about 14 years ago
- Status changed from Open to Assigned
=begin
=end
Updated by meta (mathew murphy) almost 14 years ago
=begin
Note that you'll need to decide whether you want to comply with the HTTP spec, or with RFC 3986. See http://lpar.ath0.com/2008/10/26/rfc-3986-considered-harmful/
=end
Updated by nahi (Hiroshi Nakamura) over 13 years ago
- Project changed from Ruby 1.8 to Ruby master
- Category changed from lib to lib
Updated by nahi (Hiroshi Nakamura) over 13 years ago
- Status changed from Assigned to Closed
mathew: Interesting read. Thanks. I decided to not decide and let users choose, by allowing to include query part as a request URI.