title: XMLHttpRequest over HttpClient in Rhino
body: <p>I'm working on a browser-like javascript environment in Java. A key requirement is to have an XMLHttpClient object available. In particular, I want to work with <a href="http://www.w3schools.com/html/html5_serversentevents.asp" rel="nofollow noreferrer">Server-side Events</a> and <a href="http://oauth.net/" rel="nofollow noreferrer">OAuth</a> for testing.</p>
  
  <p>So how does this XMLHttpRequest object get into Rhino?</p>
  
  <p>I was looking at some Java implementations of XMLHttpClient (e.g., <a href="https://stackoverflow.com/questions/13985560/xmlhttprequest-in-rhino">XMLHttpRequest in Rhino?</a>), but none is working flawlessly.</p>
  
  <p>Another idea was to use the Apache HttpClient library. Is this similar to what the spec for the XMLHttpRequest object requires? What is the the gap between those two? Or is there another, simpler solution that would be better?</p>
  
  <p>Thanks a lot for suggestions and feedback!</p>