Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
HTTPResponse.getHeaders()返回一个键值映射。问题是当有多个具有相同名称的标头时(例如,通常有多个“set-cookie”标头),因为您只能访问最后定义的一个。
如何访问所有同名标题?
尝试getAllHeaders()为每个键返回一个值数组(正是因为这个原因)。
getAllHeaders()