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 019import java.util.*; 020 021/** 022 * An {@link HttpBody} that carries additional headers (such as {@code Content-Type}, 023 * {@code Content-Disposition}, or {@code Content-Language}) alongside the body. 024 * 025 * <p> 026 * Mirrors the semantics of {@code HttpResource} from {@code juneau-rest-common-classic} without the 027 * Apache HttpCore dependency. The default immutable implementation is 028 * {@link org.apache.juneau.http.resource.HttpResourceBean}. 029 * 030 * <h5 class='section'>See Also:</h5><ul> 031 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/NextGenRestClient">Next-Generation REST Client</a> 032 * </ul> 033 * 034 * @since 10.0.0 035 */ 036public interface HttpResource extends HttpBody { 037 038 /** 039 * Returns the headers associated with this resource. 040 * 041 * <p> 042 * The returned list may include body-specific headers ({@code Content-Type}, {@code Content-Length}) 043 * or arbitrary application headers (e.g. {@code Cache-Control}, {@code Content-Disposition}). 044 * 045 * @return The headers. Never <jk>null</jk>. 046 */ 047 List<HttpHeader> getHeaders(); 048}