Cyrano 0 Newbie Poster

On Android phone, I used setEntity() to put the FileEntity to the POST request.

HttpPost post = new HttpPost(uri);
FileEntity reqEntity = new FileEntity(f, "application/x-gzip");
reqEntity.setContentType("binary/octet-stream");
reqEntity.setChunked(true);
post.addHeader("X-AethersNotebook-Custom", configuration.getCustomHeader());
post.setEntity(reqEntity);

When using bottle, I tried this but it is not working

f = request.body
gzipper = gzip.GzipFile( fileobj= f )
content = gzipper.read()

The content will be an empty string. So I tried to look at request.forms and request.files. Both of them have no key and value.

request.files.keys() -> empty list
request.forms.keys() -> empty list

When searching, I read about the entity: "a request MAY transfer entity" and the entity has entity-header and entity-value. So it may be something like file-content = e.get(entity-header).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.