title: How do you POST to a URL in Capybara?
body: <p>Just switched from Cucumber+Webrat to Cucumber+Capybara and I am wondering how you can POST content to a URL in Capybara.</p>
  
  <p>In Cucumber+Webrat I was able to have a step:</p>
  
  <pre><code>When /^I send "([^\"]*)" to "([^\"]*)"$/ do |file, project|
    proj = Project.find(:first, :conditions =&gt; "name='#{project}'")
    f = File.new(File.join(::Rails.root.to_s, file))
    visit "project/" + proj.id.to_s + "/upload",
          :post, {:upload_path =&gt; File.join(::Rails.root.to_s, file)}
  end
  </code></pre>
  
  <p>However, the Capybara documentation mentions:</p>
  
  <blockquote>
    <p>The visit method only takes a single
    parameter, the request method is
    always GET.always GET.</p>
  </blockquote>
  
  <p>How do I modify my step so that Cucumber+Capybara does a POST to the URL?</p>