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