我试图编写一个泽西客户端代码,该代码从服务中获取字节数组但我收到错误 我的客户代码是:
VPS
我的服务代码是:
public static byte[] downloadClient(String id){
Client client = Client.create();
WebResource webResource = client.resource(url +"/downloadFile/"+id);
ClientResponse response =
webResource.accept("application/json").get(ClientResponse.class);
byte[] buf = response.getEntity(byte[].class);
Desktop desktop = null;
desktop = Desktop.getDesktop();
return buf;
}
那有什么不对?