jira-importer opened a new issue, #831:
URL: https://github.com/apache/httpcomponents-core/issues/831

   **[Ronald E 
Johnson](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rejohnson)**
 opened 
**[HTTPCORE-137](https://issues.apache.org/jira/browse/HTTPCORE-137?redirect=false)**
 and commented
   
   I have a Java Swing application with an HttpServer() instance running in a 
SwingWorker thread.  I'm able to get at the HTTP GET requests by casting the 
request as follows:
   
   if (request instanceof HttpEntityEnclosingRequest)  {
   HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
   byte[] entityContent = EntityUtils.toByteArray(entity);
   logger.info("Incoming entity content (bytes): " + entityContent.length);
   }
   
   However this does not work for PUT requests. In fact printing out the 
request line of a PUT request appears as: "HEAD /test.txt HTTP/1.1", and I 
don't see PUT in the request line at all.  Attempting to cast this as an 
HttpEntityEnclosingRequest fails, and thus I'm not able to get at the 
HttpEntity.  Is this functionality supported?
   
   
   
   ---
   
   **Affects:** 4.0-alpha6
   
   **Attachments:**
   - 
[DefaultHttpRequestFactory.java](https://issues.apache.org/jira/secure/attachment/12372838/DefaultHttpRequestFactory.java)
 (_3.50 kB_)
   - 
[TestHTTPServer.java](https://issues.apache.org/jira/secure/attachment/12372839/TestHTTPServer.java)
 (_13.17 kB_)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to