title: Ruby Curl::Multi.http 302 redirect problems
body: <p>I seem to be having a problem with 302 redirects using curb (Ruby's curl programs)</p>
  
  <p>Here's the code snippet that is ** NOT working** (it's NOT doing the 302 redirect)</p>
  
  <blockquote>
  <pre><code>easy_options = {:follow_location =&gt; true, :enable_cookies =&gt; true, :useragent =&gt; 'curb', :cookiefile =&gt; 'cookie.txt'}
  multi_options = {:pipeline =&gt; true}
  url_fields = [
      {
          :url =&gt; 'https://x.y.z/webapps/login/',
          :method =&gt; :post,
          :follow_location =&gt; true,
          :enable_cookies =&gt; true,
          :useragent =&gt; 'curb',
          :post_fields =&gt; {
              'user_id' =&gt; 'xxxx',
              'password' =&gt; 'xxxx',
              'action' =&gt; 'login',
              'encoded_pw' =&gt; Base64.strict_encode64('xxxx')},
      }
  
  ]
  
  Curl::Multi.http(url_fields,{:pipeline =&gt; true}) do |easy, code, method|
   puts easy.header_str
  end
  </code></pre>
  </blockquote>
  
  <p>Here's the code snippet that <strong>appears to be working</strong> (it's doing the 302 redirect)</p>
  
  <blockquote>
  <pre><code>easy_options = {:follow_location =&gt; true, :enable_cookies =&gt; true, :useragent =&gt; 'curb', :cookiefile =&gt; 'cookie.txt'}
  multi_options = {:pipeline =&gt; true}
  
  url_fields = [
      { :url =&gt; 'https://x.y.z/webapps/login/',
        :post_fields =&gt; {
            'user_id' =&gt; 'xxxx',
            'password' =&gt; 'yyyy',
            'action' =&gt; 'login',
            'encoded_pw' =&gt; Base64.strict_encode64('yyyy')}}
  ]
  
  Curl::Multi.post(url_fields, easy_options, multi_options) do|easy|
    # do something interesting with the easy response
    puts easy.last_effective_url
  end
  </code></pre>
  </blockquote>
  
  <p>Question:  Why is the first block not doing the 302 redirect as expected?  :follow_location is set to true?
  Thanks in advance!</p>
  
  <p>Let me know if you need more information</p>