5
Android hỗ trợ phiên bản giới hạn ứng dụng khách apache của apache (v4). thường nếu tôi muốn gửi dữ liệu nhị phân sử dụng nội dung type = application/octet-stream qua POST, tôi thực hiện như sau:gửi dữ liệu nhị phân qua POST trên 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);
tuy nhiên ByteArrayRequestEntity không được hỗ trợ trên Android. tôi có thể làm gì?