本文整理了Java中org.springframework.web.client.RestTemplate.optionsForAllow
方法的一些代码示例,展示了RestTemplate.optionsForAllow
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RestTemplate.optionsForAllow
方法的具体详情如下:
包路径:org.springframework.web.client.RestTemplate
类名称:RestTemplate
方法名:optionsForAllow
暂无
代码示例来源:origin: spring-projects/spring-framework
@Test
public void optionsForAllow() throws URISyntaxException {
Set<HttpMethod> allowed = template.optionsForAllow(new URI(baseUrl + "/get"));
assertEquals("Invalid response",
EnumSet.of(HttpMethod.GET, HttpMethod.OPTIONS, HttpMethod.HEAD, HttpMethod.TRACE), allowed);
}
代码示例来源:origin: spring-projects/spring-framework
@Test
public void optionsForAllow() throws Exception {
mockSentRequest(OPTIONS, "http://example.com");
mockResponseStatus(HttpStatus.OK);
HttpHeaders responseHeaders = new HttpHeaders();
EnumSet<HttpMethod> expected = EnumSet.of(GET, POST);
responseHeaders.setAllow(expected);
given(response.getHeaders()).willReturn(responseHeaders);
Set<HttpMethod> result = template.optionsForAllow("http://example.com");
assertEquals("Invalid OPTIONS result", expected, result);
verify(response).close();
}
代码示例来源:origin: apache/servicecomb-java-chassis
@Override
public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url);
}
代码示例来源:origin: apache/servicecomb-java-chassis
@Override
public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url, urlVariables);
}
代码示例来源:origin: apache/servicecomb-java-chassis
@Override
public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url, urlVariables);
}
代码示例来源:origin: FastBootWeixin/FastBootWeixin
public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> uriVariables) throws RestClientException {
return restTemplate.optionsForAllow(url, uriVariables);
}
代码示例来源:origin: FastBootWeixin/FastBootWeixin
public Set<HttpMethod> optionsForAllow(String url, Object... uriVariables) throws RestClientException {
return restTemplate.optionsForAllow(url, uriVariables);
}
代码示例来源:origin: FastBootWeixin/FastBootWeixin
public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
return restTemplate.optionsForAllow(url);
}
代码示例来源:origin: org.springframework.boot/spring-boot-test
/**
* Return the value of the Allow header for the given URI.
* <p>
* URI Template variables are expanded using the given URI variables, if any.
* @param url the URL
* @param urlVariables the variables to expand in the template
* @return the value of the allow header
* @throws RestClientException on client-side HTTP error
* @see RestTemplate#optionsForAllow(java.lang.String, java.lang.Object[])
*/
public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables)
throws RestClientException {
return this.restTemplate.optionsForAllow(url, urlVariables);
}
代码示例来源:origin: org.springframework.boot/spring-boot-test
/**
* Return the value of the Allow header for the given URI.
* <p>
* URI Template variables are expanded using the given map.
* @param url the URL
* @param urlVariables the variables to expand in the template
* @return the value of the allow header
* @throws RestClientException on client-side HTTP error
* @see RestTemplate#optionsForAllow(java.lang.String, java.util.Map)
*/
public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables)
throws RestClientException {
return this.restTemplate.optionsForAllow(url, urlVariables);
}
代码示例来源:origin: com.lodsve/lodsve-web
public static Set<HttpMethod> options(URI url) throws RestClientException {
return restTemplate.optionsForAllow(url);
}
代码示例来源:origin: io.servicecomb/provider-springmvc
@Override
public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url);
}
代码示例来源:origin: org.springframework.boot/spring-boot-test
/**
* Return the value of the Allow header for the given URL.
* @param url the URL
* @return the value of the allow header
* @throws RestClientException on client-side HTTP error
* @see RestTemplate#optionsForAllow(java.net.URI)
*/
public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
return this.restTemplate.optionsForAllow(applyRootUriIfNecessary(url));
}
代码示例来源:origin: org.apache.servicecomb/provider-springmvc
@Override
public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url, urlVariables);
}
代码示例来源:origin: org.apache.servicecomb/provider-springmvc
@Override
public Set<HttpMethod> optionsForAllow(URI url) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url);
}
代码示例来源:origin: org.apache.servicecomb/provider-springmvc
@Override
public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url, urlVariables);
}
代码示例来源:origin: io.servicecomb/provider-springmvc
@Override
public Set<HttpMethod> optionsForAllow(String url, Object... urlVariables) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url, urlVariables);
}
代码示例来源:origin: io.servicecomb/provider-springmvc
@Override
public Set<HttpMethod> optionsForAllow(String url, Map<String, ?> urlVariables) throws RestClientException {
return getRestTemplate(url).optionsForAllow(url, urlVariables);
}
内容来源于网络,如有侵权,请联系作者删除!