我必须按照以下代码在java中设置cookie:
urlConn.setRequestProperty("Cookie", "userid=xy");
但是我需要设置多个cookie,我该怎么做?
最佳答案
来自Javadoc :
public void addRequestProperty(String key, String value)
Adds a general request property specified by a key-value pair. This method will not overwrite existing values associated with the same key.
关于java - java中如何设置多个cookie?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8260377/