title: How to Parse (not get) an HTTP Request in Ruby
body: <p>I have an integration test which uses eventmachine to receive http requests.  This is my eventmachine handler:</p>
  
  <pre><code>class NotificationRecipient &lt; EM::Connection
    def receive_data(data)
      EM.stop
    end
  end
  </code></pre>
  
  <p>I need to test various properies of the received request, e.g. I want to extract a json payload from an HTTP POST request string I've received like this.  Is there a nicely packaged way to do it?  </p>
  
  <p>Googling finds lots of ways to make a request and parse the response, e.g. rest-client will parse response automatically.  However, since I'm receiving the request, not making it, none of these ways work for me.</p>