title: Using Ruby Script to perform a login
body: <p>my goal is to use a ruby script to perform a login.
  The website uses javascript to render the login form therefore I cannot use mechanize. I want to avoid using selenium,</p>
  
  <p>If I were to login with false data, I can see under the network section, that an action url is performed -> 
  Request URL: <a href="https://www.example.com/admin/bocontroller/bocontroller.cfm?action=dologin" rel="nofollow noreferrer">https://www.example.com/admin/bocontroller/bocontroller.cfm?action=dologin</a></p>
  
  <p>further down I can see the Form Data
  -> 
  username: Sample
  password: 12345678</p>
  
  <p>Based on this I tried to write several scripts (this being the closest i hope...)</p>
  
  <pre><code>require "net/http"
  require "uri"
  
  uri = URI.parse("https://www.eample.com/admin/bocontroller/bocontroller.cfm?action=dologin")
  
  
  http = Net::HTTP.new(uri.host, uri.port)
  
  request = Net::HTTP::Post.new(uri.request_uri)
  request.set_form_data({'username' =&gt; 'Sample', 'password' =&gt; '12345678'})
  
  request["Content-Type"] = "application/json"
  
  response = http.request(request)
  </code></pre>
  
  <p>Unfortunately My script just stops running... and I am kind of lost. Can anyone give me some hints to lead me into the right direction? IS this the right approach?</p>