这是我的网络服务
//the Web Service
@POST
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public Response upload(byte[] input) {
// store input somewhere
System.out.println("Done");
return Response.ok().build();
}
如何使用 cURL 对其进行测试?
最佳答案
假设二进制文件在文件中,例如图像或其他东西,您可以这样尝试:
$ curl -X POST -d @image1.png -H content-type:application/octet-stream http://yourserver/path
关于java - 如何使用 cURL 来使用以字节为参数的 Apache CXF Web 服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38416485/