在Android手机上,我使用setEntity()将FileEntity放入POST请求。在
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);
使用瓶子时,尝试过这个,但它不起作用
^{pr2}$内容将是空字符串。所以我试着看看请求.表单以及请求.files. 它们都没有键和值。在
request.files.keys()
request.forms.keys()
在搜索时,我读到了关于实体的信息:“一个请求可以转移实体”,并且实体有实体头和实体值。所以它可能类似于file content=e.get(实体头)。在
使用该代码,手机发送文件使用分块编码。因为py-bottle不支持分块编码,所以这里的解决方案是重写android,将文件作为POST请求的主体发送。在
相关问题 更多 >
编程相关推荐