title: How to implement cookies in Ruby Net::HTTP
body: <p>That's my code.</p>
  
  <p>Now I need to SEND a cookie to the host but I can't find a solution.</p>
  
  <hr>
  
  <pre><code>def get_network_file(url=nil)
    begin
      http = Net::HTTP.new( @service_server, 80 )
      resp, data = http.get( url, { "Accept-Language" =&gt; @locale } )
      if resp.code.to_i != 200
        RAILS_DEFAULT_LOGGER.error "*** return code != 200. code = #{resp.code}"
        return ""
      end
      rescue Exception =&gt; exc
        RAILS_DEFAULT_LOGGER.error "*** message --&gt; #{exc.message}"
        return ""
      end
      return data
    end
  end
  </code></pre>
  
  <hr>