org.springframework.web.client.RestTemplate.optionsForAllow()方法的使用及代码示例

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

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

RestTemplate.optionsForAllow介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

  1. @Test
  2. public void optionsForAllow() throws URISyntaxException {
  3. Set<HttpMethod> allowed = template.optionsForAllow(new URI(baseUrl + "/get"));
  4. assertEquals("Invalid response",
  5. EnumSet.of(HttpMethod.GET, HttpMethod.OPTIONS, HttpMethod.HEAD, HttpMethod.TRACE), allowed);
  6. }

代码示例来源:origin: spring-projects/spring-framework

  1. @Test
  2. public void optionsForAllow() throws Exception {
  3. mockSentRequest(OPTIONS, "http://example.com");
  4. mockResponseStatus(HttpStatus.OK);
  5. HttpHeaders responseHeaders = new HttpHeaders();
  6. EnumSet<HttpMethod> expected = EnumSet.of(GET, POST);
  7. responseHeaders.setAllow(expected);
  8. given(response.getHeaders()).willReturn(responseHeaders);
  9. Set<HttpMethod> result = template.optionsForAllow("http://example.com");
  10. assertEquals("Invalid OPTIONS result", expected, result);
  11. verify(response).close();
  12. }

代码示例来源:origin: apache/servicecomb-java-chassis

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url);
  4. }

代码示例来源:origin: apache/servicecomb-java-chassis

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url, urlVariables);
  4. }

代码示例来源:origin: apache/servicecomb-java-chassis

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url, urlVariables);
  4. }

代码示例来源:origin: FastBootWeixin/FastBootWeixin

  1. public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> uriVariables) throws RestClientException {
  2. return restTemplate.optionsForAllow(url, uriVariables);
  3. }

代码示例来源:origin: FastBootWeixin/FastBootWeixin

  1. public Set<HttpMethod> optionsForAllow(String url, Object... uriVariables) throws RestClientException {
  2. return restTemplate.optionsForAllow(url, uriVariables);
  3. }

代码示例来源:origin: FastBootWeixin/FastBootWeixin

  1. public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
  2. return restTemplate.optionsForAllow(url);
  3. }

代码示例来源:origin: org.springframework.boot/spring-boot-test

  1. /**
  2. * Return the value of the Allow header for the given URI.
  3. * <p>
  4. * URI Template variables are expanded using the given URI variables, if any.
  5. * @param url the URL
  6. * @param urlVariables the variables to expand in the template
  7. * @return the value of the allow header
  8. * @throws RestClientException on client-side HTTP error
  9. * @see RestTemplate#optionsForAllow(java.lang.String, java.lang.Object[])
  10. */
  11. public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables)
  12. throws RestClientException {
  13. return this.restTemplate.optionsForAllow(url, urlVariables);
  14. }

代码示例来源:origin: org.springframework.boot/spring-boot-test

  1. /**
  2. * Return the value of the Allow header for the given URI.
  3. * <p>
  4. * URI Template variables are expanded using the given map.
  5. * @param url the URL
  6. * @param urlVariables the variables to expand in the template
  7. * @return the value of the allow header
  8. * @throws RestClientException on client-side HTTP error
  9. * @see RestTemplate#optionsForAllow(java.lang.String, java.util.Map)
  10. */
  11. public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables)
  12. throws RestClientException {
  13. return this.restTemplate.optionsForAllow(url, urlVariables);
  14. }

代码示例来源:origin: com.lodsve/lodsve-web

  1. public static Set<HttpMethod> options(URI url) throws RestClientException {
  2. return restTemplate.optionsForAllow(url);
  3. }

代码示例来源:origin: io.servicecomb/provider-springmvc

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url);
  4. }

代码示例来源:origin: org.springframework.boot/spring-boot-test

  1. /**
  2. * Return the value of the Allow header for the given URL.
  3. * @param url the URL
  4. * @return the value of the allow header
  5. * @throws RestClientException on client-side HTTP error
  6. * @see RestTemplate#optionsForAllow(java.net.URI)
  7. */
  8. public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
  9. return this.restTemplate.optionsForAllow(applyRootUriIfNecessary(url));
  10. }

代码示例来源:origin: org.apache.servicecomb/provider-springmvc

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url, urlVariables);
  4. }

代码示例来源:origin: org.apache.servicecomb/provider-springmvc

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url);
  4. }

代码示例来源:origin: org.apache.servicecomb/provider-springmvc

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url, urlVariables);
  4. }

代码示例来源:origin: io.servicecomb/provider-springmvc

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url, urlVariables);
  4. }

代码示例来源:origin: io.servicecomb/provider-springmvc

  1. @Override
  2. public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables) throws RestClientException {
  3. return getRestTemplate(url).optionsForAllow(url, urlVariables);
  4. }

相关文章