Hello David,

I've just tested using simply curl (command line : "curl -X POST
http://localhost:8183/david -d @fichier.txt") and nc (command line : "nc -l
8183"), and I can reproduce the same behaviour.
You must use the curl --data-binary option :
"curl -X POST http://localhost:8183/david --data-binary @fichier.txt")

Best regards,
Thierry Boileau

Hi
>
> I am using curl -X POST uri -d @textfile to post the content of a file to a
> restlet resource. The representation I get loses the line break. Does
> anyone
> know what I'm doing wrong ?
>
> This is my post method
>
>    @Post
>    public String post_method(Representation entity){
>                StringWriter writer = new StringWriter();
>                        IOUtils.copy(input, writer);
>                String trans_doc = writer.toString();
>          System.out.println(trans_doc);
>    }
> }
>
> I've tried to encode the input stream with UTF-8 but the line break is
> still
> lost. Any ideas ?
>
> Thanks, David
>
> --
> View this message in context:
> http://restlet-discuss.1400322.n2.nabble.com/InputStream-loses-line-break-tp7578037.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2968073
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2969961

Reply via email to