违反协议:块大小中出现意外的单个换行符

时间:2012-08-30 08:26:28

标签: java jersey httpclient

第三方服务正在使用HttpClient(3.1)来获取我通过Jersey(在tomcat上)服务的网址。这是在主题中抛出错误。

这就是我提供网址的方式:

@Path("somepath")
@GET
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response download(@Context UriInfo uriInfo)  {
    try {
        URL url = // find the actual URL (a file)
        InputStream stream = url.openStream();
        return Response.ok(stream).build();
    } catch (IOException e) {
        return Responses.notFound().build();
    }
}

有办法解决这个问题吗?

0 个答案:

没有答案