5
Android支持apache的http客户端(v4)的有限版本。 通常如果我想使用内容类型=应用/八位字节流通过POST, 发送二进制数据I执行以下操作:在Android上通过POST发送二进制数据Android
HttpClient client = getHttpClient(); HttpPost method=new HttpPost("http://192.168.0.1:8080/xxx"); System.err.println("send to server "+s); if(compression){ byte[]compressed =compress(s); RequestEntity entity = new ByteArrayRequestEntity(compressed); method.setEntity(entity); } HttpResponse resp=client.execute(method);
然而ByteArrayRequestEntity不支持机器人。我能做什么?