javax.ws.rs.core.Response.getLink()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中javax.ws.rs.core.Response.getLink方法的一些代码示例,展示了Response.getLink的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.getLink方法的具体详情如下:
包路径:javax.ws.rs.core.Response
类名称:Response
方法名:getLink

Response.getLink介绍

[英]Get the link for the relation. A relative link is resolved with respect to the actual request URI that produced this response. Note that request URIs may be updated by filters, so the actual request URI may differ from that in the original invocation.
[中]获取关系的链接。相对于生成此响应的实际请求URI解析相对链接。请注意,请求URI可能会被过滤器更新,因此实际的请求URI可能与原始调用中的不同。

代码示例

代码示例来源:origin: SAP/cloud-s4-sdk-examples

@Override
public Link getLink(final String relation)
{
  return delegate.getLink(relation);
}

代码示例来源:origin: com.cerner.beadledom/beadledom-resteasy-genericresponse

@Override
public Link getLink(String relation) {
 return rawResponse.getLink(relation);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public Link getLink(String rel) {
  return r.getLink(rel);
}

代码示例来源:origin: ocadotechnology/newrelic-alerts-configurator

<T, LT extends ObjectList<T, LT>> LT getPageable(Builder request, Class<LT> responseType) {
  Response response = request.get();
  LT responseBody = response.readEntity(responseType);
  Link next = response.getLink("next");
  return followPageable(next, responseBody, responseType);
}

代码示例来源:origin: ocadotechnology/newrelic-alerts-configurator

private <T, LT extends ObjectList<T, LT>> LT followPageable(Link next, LT responseBody, Class<LT> responseType) {
    while (next != null) {
      Response nextResponse = client.target(next).request(APPLICATION_JSON_TYPE).get();
      LT nextResponseBody = nextResponse.readEntity(responseType);
      responseBody = responseBody.merge(nextResponseBody);
      next = nextResponse.getLink("next");
    }
    return responseBody;
  }
}

代码示例来源:origin: apache/cxf

@Test
public void testGetBookLink() throws Exception {
  String address = "http://localhost:" + PORT + "/the/bookstore/link";
  WebClient wc = WebClient.create(address);
  Response r = wc.get();
  Link l = r.getLink("self");
  assertEquals("<http://localhost:" + PORT + "/the/bookstore/>;rel=\"self\"",
         l.toString());
}
private void doTestGetBookISO(String charset, String pathSegment) throws Exception {

相关文章