Java Code Examples for org.springframework.http.HttpHeaders#getLocation()

The following examples show how to use org.springframework.http.HttpHeaders#getLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RestTemplate.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
@Nullable
public URI postForLocation(String url, @Nullable Object request, Object... uriVariables)
		throws RestClientException {

	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), uriVariables);
	return (headers != null ? headers.getLocation() : null);
}
 
Example 2
Source File: RestTemplate.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
@Nullable
public URI postForLocation(String url, @Nullable Object request, Map<String, ?> uriVariables)
		throws RestClientException {

	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), uriVariables);
	return (headers != null ? headers.getLocation() : null);
}
 
Example 3
Source File: RestTemplate.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
@Nullable
public URI postForLocation(URI url, @Nullable Object request) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor());
	return (headers != null ? headers.getLocation() : null);
}
 
Example 4
Source File: AsyncRestTemplate.java    From spring-analysis-note with MIT License 5 votes vote down vote up
private static ListenableFuture<URI> adaptToLocationHeader(ListenableFuture<HttpHeaders> future) {
	return new ListenableFutureAdapter<URI, HttpHeaders>(future) {
		@Override
		@Nullable
		protected URI adapt(HttpHeaders headers) throws ExecutionException {
			return headers.getLocation();
		}
	};
}
 
Example 5
Source File: RestTemplate.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
@Nullable
public URI postForLocation(String url, @Nullable Object request, Object... uriVariables)
		throws RestClientException {

	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), uriVariables);
	return (headers != null ? headers.getLocation() : null);
}
 
Example 6
Source File: RestTemplate.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
@Nullable
public URI postForLocation(String url, @Nullable Object request, Map<String, ?> uriVariables)
		throws RestClientException {

	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), uriVariables);
	return (headers != null ? headers.getLocation() : null);
}
 
Example 7
Source File: RestTemplate.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
@Nullable
public URI postForLocation(URI url, @Nullable Object request) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor());
	return (headers != null ? headers.getLocation() : null);
}
 
Example 8
Source File: AsyncRestTemplate.java    From java-technology-stack with MIT License 5 votes vote down vote up
private static ListenableFuture<URI> adaptToLocationHeader(ListenableFuture<HttpHeaders> future) {
	return new ListenableFutureAdapter<URI, HttpHeaders>(future) {
		@Override
		@Nullable
		protected URI adapt(HttpHeaders headers) throws ExecutionException {
			return headers.getLocation();
		}
	};
}
 
Example 9
Source File: AsyncRestTemplate.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private static ListenableFuture<URI> adaptToLocationHeader(ListenableFuture<HttpHeaders> future) {
	return new ListenableFutureAdapter<URI, HttpHeaders>(future) {
		@Override
		protected URI adapt(HttpHeaders headers) throws ExecutionException {
			return headers.getLocation();
		}
	};
}
 
Example 10
Source File: RestTemplate.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public URI postForLocation(String url, Object request, Object... uriVariables) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), uriVariables);
	return headers.getLocation();
}
 
Example 11
Source File: RestTemplate.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public URI postForLocation(String url, Object request, Map<String, ?> uriVariables) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), uriVariables);
	return headers.getLocation();
}
 
Example 12
Source File: RestTemplate.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public URI postForLocation(URI url, Object request) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor());
	return headers.getLocation();
}
 
Example 13
Source File: RestTemplate.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public URI postForLocation(String url, Object request, Object... urlVariables) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), urlVariables);
	return headers.getLocation();
}
 
Example 14
Source File: RestTemplate.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public URI postForLocation(String url, Object request, Map<String, ?> urlVariables) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor(), urlVariables);
	return headers.getLocation();
}
 
Example 15
Source File: RestTemplate.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public URI postForLocation(URI url, Object request) throws RestClientException {
	RequestCallback requestCallback = httpEntityCallback(request);
	HttpHeaders headers = execute(url, HttpMethod.POST, requestCallback, headersExtractor());
	return headers.getLocation();
}