我正在使用com.sun.jersey.api
。
下面是获取响应标题的代码部分。
Client client = Client.create();
WebResource webResource = client.resource( url );
ClientResponse response = webResource.header("Authorization", authorization )
.header( "X-FeClient-Token",clienttoken)
.post( ClientResponse.class, "" );
MultivaluedMap<String, String> respmap=response.getHeaders();
它仅提供默认的标题详细信息。我无法在响应中发送自定义标题。我可以在邮递员工具中看到自定义标头。
我假设标题被您使用的提供程序阻止。您需要启用它们。根据您使用的框架,您将需要实现一个Filter来执行此操作。
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers