已连接时 Java AddRequestProperty?
如果您已经连接到 URLConnection,是否可以使用 addRequestProperty? 我需要这样做,因为我首先必须连接以获取第一个 Cookie 的标头字段,但后来我必须发送第一个 Cookie 才能获取定义了第二个 set-cookie 字段的标头字段。
Is there a way to use addRequestProperty if you have already connected to the URLConnection?
I need to do this cause I first have to connect to get the headerfields for the first Cookie, but later I have to send that first Cookie in order to get headerfields where a second set-cookie field is defined.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那是行不通的。 HTTP 协议将这些属性作为请求数据开头的标头项进行传送。您将需要多个请求。
That won't work. The HTTP protocol conveys those properties as header items at the beginning of the request data. You'll need multiple requests.