目前我在请求URL中传递会话ID,如下所示,从其中一个客户端输入现有会话
String urlStr = "/App1/MyApp.do;jsessionid=someSessionId";
Properties reply = new Properties();
URL url = new URL(urlStr);
URLConnection conn = url.openConnection();
conn.getInputStream()
我想要的是在请求标头中传递会话ID,而不是将其作为url参数传递。任何想法?
答案 0 :(得分:1)
您可以尝试以下内容:
ArrayList<Object> providers = new ArrayList<Object>();
providers.add(new JacksonJsonProvider());
WebClient client = WebClient.create(""/App1/MyApp.do", providers);
client.header("jsessionid", someSessionId);