Merge branch '5.1.x'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,10 +35,11 @@ import org.springframework.http.HttpStatus;
|
||||
public interface ClientHttpResponse extends HttpInputMessage, Closeable {
|
||||
|
||||
/**
|
||||
* Return the HTTP status code of the response.
|
||||
* @return the HTTP status as an HttpStatus enum value
|
||||
* Return the HTTP status code as an {@link HttpStatus} enum value.
|
||||
* @return the HTTP status as an HttpStatus enum value (never {@code null})
|
||||
* @throws IOException in case of I/O errors
|
||||
* @throws IllegalArgumentException in case of an unknown HTTP status code
|
||||
* @since #getRawStatusCode()
|
||||
* @see HttpStatus#valueOf(int)
|
||||
*/
|
||||
HttpStatus getStatusCode() throws IOException;
|
||||
@@ -46,7 +47,7 @@ public interface ClientHttpResponse extends HttpInputMessage, Closeable {
|
||||
/**
|
||||
* Return the HTTP status code (potentially non-standard and not
|
||||
* resolvable through the {@link HttpStatus} enum) as an integer.
|
||||
* @return the HTTP status as an integer
|
||||
* @return the HTTP status as an integer value
|
||||
* @throws IOException in case of I/O errors
|
||||
* @since 3.1.1
|
||||
* @see #getStatusCode()
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.http.client.reactive;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ReactiveHttpInputMessage;
|
||||
import org.springframework.http.ResponseCookie;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
/**
|
||||
@@ -32,18 +31,18 @@ import org.springframework.util.MultiValueMap;
|
||||
public interface ClientHttpResponse extends ReactiveHttpInputMessage {
|
||||
|
||||
/**
|
||||
* Return the HTTP status code of the response.
|
||||
* @return the HTTP status as an HttpStatus enum value
|
||||
* Return the HTTP status code as an {@link HttpStatus} enum value.
|
||||
* @return the HTTP status as an HttpStatus enum value (never {@code null})
|
||||
* @throws IllegalArgumentException in case of an unknown HTTP status code
|
||||
* @see HttpStatus#resolve(int)
|
||||
* @since #getRawStatusCode()
|
||||
* @see HttpStatus#valueOf(int)
|
||||
*/
|
||||
@Nullable
|
||||
HttpStatus getStatusCode();
|
||||
|
||||
/**
|
||||
* Return the HTTP status code (potentially non-standard and not
|
||||
* resolvable through the {@link HttpStatus} enum) as an integer.
|
||||
* @return the HTTP status as an integer
|
||||
* @return the HTTP status as an integer value
|
||||
* @since 5.0.6
|
||||
* @see #getStatusCode()
|
||||
* @see HttpStatus#resolve(int)
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ClientHttpResponseDecorator implements ClientHttpResponse {
|
||||
}
|
||||
|
||||
|
||||
// ServerHttpResponse delegation methods...
|
||||
// ClientHttpResponse delegation methods...
|
||||
|
||||
@Override
|
||||
public HttpStatus getStatusCode() {
|
||||
|
||||
@@ -53,7 +53,7 @@ class JettyClientHttpResponse implements ClientHttpResponse {
|
||||
|
||||
@Override
|
||||
public HttpStatus getStatusCode() {
|
||||
return HttpStatus.resolve(getRawStatusCode());
|
||||
return HttpStatus.valueOf(getRawStatusCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -88,7 +88,7 @@ class ReactorClientHttpResponse implements ClientHttpResponse {
|
||||
|
||||
@Override
|
||||
public HttpStatus getStatusCode() {
|
||||
return HttpStatus.resolve(getRawStatusCode());
|
||||
return HttpStatus.valueOf(getRawStatusCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user