Setting custom headers during a POST operation worked in taf2-curb in
0.2.8.0 but upgrading to the latest 0.4.8.0 does not work - throws
script/curb.rb:11: undefined method `headers' for #<Curl::Multi:
from script/curb.rb:10:in `http_post'
The code is:
post_fields = [
c = Curl::Easy.http_post('http://localhost:3000/
', *post_fields) do |
curl.headers['User-Agent'] = 'Mozilla 0.5',
curl.headers['Content-Type'] = 'application/x-www-form-urlencoded'
curl.follow_location = true
curl.max_redirects = 5
curl.connect_timeout = 5
curl.timeout = 5
Like I said, works fine in 0.2.8.0, fails in 0.4.8.0. I *used* to set
my headers via a straight assignment:
curl.headers = my_headers_hash
But switched to the more verbose style of setting each one because I
thought this error might have been related to the previous bug with
headers and PUT:
and your comment about having to do the hash-style of setting them.
But as you can see this error is different.
Thanks in advance.