首页 > 解决方案 > 将 cookie 添加到 GET 请求未显示

问题描述

我正在尝试将 cookie 添加到包含令牌的 GET 请求中。我尝试了以下方法:

WebTarget wt = client.target(url).path(path);
wt.queryParam(binaryRepsonse, binaryResponse)
    .request(new MediaType[] {MediaType.APPLICATION_OCTET_STREAM_TYPE})
    .cookie("session", userCredential)
    .get(InputStream.class);

但是,它似乎没有添加任何 cookie。任何指针?

标签: cookiesjersey

解决方案


推荐阅读