我有功能
@POST
@Consumes({ ExampleMediaTypes.PLAINTEXT_0_1_0, MediaType.TEXT_PLAIN, ExampleMediaTypes.SIMPLE_PROTOBUF_0_1_0, ExampleMediaTypes.SIMPLE_JSON_0_1_0, ExampleMediaTypes.STRUCTURED_JSON_0_1_0 })
@Produces({ PredictionMediaTypes.PLAINTEXT_0_1_0 })
@Path("/main")
public ChunkedOutput<String> doPredict(ExamplesIterable examplesIterable,@HeaderParam("User-Agent") String userAgent, @HeaderParam("Cookie") String cookies) throws IOException {
System.out.println("hello");
System.out.println(cookies);
System.out.println(userAgent);
return new RequestHandler(executorService, exampleProcessorFactory).handleRequest(examplesIterable);
}
当我用以下方法测试时,它只打印cookie值
curl -H "Content-Type:text/plain" -X POST -T /home/aleksander/bandit/daemon/test_cb.dat http://localhost:8080/vw-webservice-jersey/predict/main -v -b "cookieName:cookieValue;secondCookie:value"
我明白了:
hello
null
curl/7.35.0
问题是什么?这个错误的卷曲请求或注释是错误的吗?