001/* 002 * Copyright 2002-2019 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.http.client.reactive; 018 019import org.springframework.http.HttpStatus; 020import org.springframework.http.ReactiveHttpInputMessage; 021import org.springframework.http.ResponseCookie; 022import org.springframework.util.MultiValueMap; 023 024/** 025 * Represents a client-side reactive HTTP response. 026 * 027 * @author Arjen Poutsma 028 * @author Brian Clozel 029 * @since 5.0 030 */ 031public interface ClientHttpResponse extends ReactiveHttpInputMessage { 032 033 /** 034 * Return the HTTP status code as an {@link HttpStatus} enum value. 035 * @return the HTTP status as an HttpStatus enum value (never {@code null}) 036 * @throws IllegalArgumentException in case of an unknown HTTP status code 037 * @since #getRawStatusCode() 038 * @see HttpStatus#valueOf(int) 039 */ 040 HttpStatus getStatusCode(); 041 042 /** 043 * Return the HTTP status code (potentially non-standard and not 044 * resolvable through the {@link HttpStatus} enum) as an integer. 045 * @return the HTTP status as an integer value 046 * @since 5.0.6 047 * @see #getStatusCode() 048 * @see HttpStatus#resolve(int) 049 */ 050 int getRawStatusCode(); 051 052 /** 053 * Return a read-only map of response cookies received from the server. 054 */ 055 MultiValueMap<String, ResponseCookie> getCookies(); 056 057}