001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.http; 018 019/** 020 * The first line of an HTTP response message, containing the protocol version, status code, and reason phrase. 021 * 022 * <p> 023 * Mirrors the semantics of {@code org.apache.http.StatusLine} without the Apache HttpCore dependency. 024 * The default immutable implementation is {@link org.apache.juneau.http.response.HttpStatusLineBean}. 025 * 026 * <h5 class='section'>See Also:</h5><ul> 027 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/NextGenRestClient">Next-Generation REST Client</a> 028 * </ul> 029 * 030 * @since 9.2.1 031 */ 032public interface HttpStatusLine { 033 034 /** 035 * Returns the HTTP status code (e.g. {@code 200}, {@code 404}). 036 * 037 * @return The status code. 038 */ 039 int getStatusCode(); 040 041 /** 042 * Returns the human-readable reason phrase (e.g. {@code "OK"}, {@code "Not Found"}), or <jk>null</jk> if absent. 043 * 044 * @return The reason phrase, possibly <jk>null</jk>. 045 */ 046 String getReasonPhrase(); 047 048 /** 049 * Returns the HTTP protocol version (e.g. {@link HttpProtocolVersion#HTTP_1_1}). 050 * 051 * @return The protocol version. Never <jk>null</jk>. 052 */ 053 HttpProtocolVersion getProtocolVersion(); 054}