Hello Peter,

if you want to get the raw data, you can use netcat (in listening mode
=> "nc -l -p <port number>") instead of your server.
You will get all headers and message body of the request sent by the
mobile phone.

best regards,
Thierry Boileau


On Fri, Mar 7, 2008 at 11:12 PM, Peter Neubauer
<[EMAIL PROTECTED]> wrote:
> Hi,
>  I am trying to get over image data from a mobile phone using a very simple 
> model
>  where the data is sent as, according to the restlet Request headers,
>
>  Content-Type: application/octet-stream
>  Transfer-Encoding: chunked
>
>  And the code sending it from the phone looks like
>
>
>  conn = (HttpConnection) Connector.open(restServiceUrl);
>  conn.setRequestMethod(HttpConnection.POST);
>  os = conn.openOutputStream();
>  os.write(data); //data is a byte array
>  os.flush();
>
>  However, using this code in my Resource:
>
>  public void post(Representation entity) {
>  Request request = getRequest();
>  System.out.println("request: " + request.getAttributes()
>  InputRepresentation input = (InputRepresentation) entity;
>  System.out.println("Input length: " + input.getSize());
>
>  gives me imput.getSize() of -1.
>
>  Is ther eanything that sits between me and the data? Is there any way to get 
> to
>  the raw data that is coming over the stream? Am I using the wrong calls?
>
>  Thanks for any hints!
>
>  Cheers
>
>  /peter
>
>

Reply via email to