Note that there are some explanatory texts on larger screens.

plurals
  1. POIssues getting Netty sample "HttpUploadServer" to read HTTP PUT data, works fine with HTTP POST
    primarykey
    data
    text
    <p>I am trying to get the sample Netty HttpUploadServer to receive an uploaded file via HTTP PUT, code found here: <a href="https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/http/upload/HttpUploadServerHandler.java" rel="nofollow">https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/http/upload/HttpUploadServerHandler.java</a></p> <p>To test an HTTP POST file upload, I use this curl command:</p> <pre><code>curl -F "myfile=@testfile.txt" http://127.0.0.1:8080 </code></pre> <p>To test an HTTP PUT file upload, I use this curl command:</p> <pre><code>curl -T "testfile.txt" http://127.0.0.1:8080 </code></pre> <p>I commented out the writeMenu and return as i'm using curl and not a web browser. Using curl to POST, everything seems to work fine, however with PUT I am not getting any data in readHttpDataAllRecieve (HttpUploadServerhandler):</p> <pre><code>private void readHttpDataAllReceive(Channel channel) { List&lt;InterfaceHttpData&gt; datas = null; try { datas = decoder.getBodyHttpDatas(); System.out.println("size " + datas.size()); } catch (NotEnoughDataDecoderException e1) { // Should not be! e1.printStackTrace(); responseContent.append(e1.getMessage()); writeResponse(channel); Channels.close(channel); return; } for (InterfaceHttpData data: datas) { writeHttpData(data); } responseContent.append("\r\n\r\nEND OF CONTENT AT FINAL END\r\n"); } </code></pre> <p>datas = decoder.getBodyHttpDatas(); datas always has a 0 size with PUT, but not with POST. </p> <p>Thanks for any ideas</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload