View Javadoc

1   /*
2    * ====================================================================
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   * ====================================================================
20   *
21   * This software consists of voluntary contributions made by many
22   * individuals on behalf of the Apache Software Foundation.  For more
23   * information on the Apache Software Foundation, please see
24   * <http://www.apache.org/>.
25   *
26   */
27  
28  package org.apache.http.params;
29  
30  import org.apache.http.ProtocolVersion;
31  
32  /**
33   * Defines parameter names for protocol execution in HttpCore.
34   *
35   * @since 4.0
36   */
37  public interface CoreProtocolPNames {
38  
39      /**
40       * Defines the {@link ProtocolVersion} used per default.
41       * <p>
42       * This parameter expects a value of type {@link ProtocolVersion}.
43       * </p>
44       */
45      public static final String PROTOCOL_VERSION = "http.protocol.version";
46  
47      /**
48       * Defines the charset to be used for encoding HTTP protocol elements.
49       * <p>
50       * This parameter expects a value of type {@link String}.
51       * </p>
52       */
53      public static final String HTTP_ELEMENT_CHARSET = "http.protocol.element-charset";
54  
55      /**
56       * Defines the charset to be used per default for encoding content body.
57       * <p>
58       * This parameter expects a value of type {@link String}.
59       * </p>
60       */
61      public static final String HTTP_CONTENT_CHARSET = "http.protocol.content-charset";
62  
63      /**
64       * Defines the content of the <code>User-Agent</code> header.
65       * <p>
66       * This parameter expects a value of type {@link String}.
67       * </p>
68       */
69      public static final String USER_AGENT = "http.useragent";
70  
71      /**
72       * Defines the content of the <code>Server</code> header.
73       * <p>
74       * This parameter expects a value of type {@link String}.
75       * </p>
76       */
77      public static final String ORIGIN_SERVER = "http.origin-server";
78  
79      /**
80       * Defines whether responses with an invalid <code>Transfer-Encoding</code>
81       * header should be rejected.
82       * <p>
83       * This parameter expects a value of type {@link Boolean}.
84       * </p>
85       */
86      public static final String STRICT_TRANSFER_ENCODING = "http.protocol.strict-transfer-encoding";
87  
88      /**
89       * <p>
90       * Activates 'Expect: 100-Continue' handshake for the
91       * entity enclosing methods. The purpose of the 'Expect: 100-Continue'
92       * handshake is to allow a client that is sending a request message with
93       * a request body to determine if the origin server is willing to
94       * accept the request (based on the request headers) before the client
95       * sends the request body.
96       * </p>
97       *
98       * <p>
99       * The use of the 'Expect: 100-continue' handshake can result in
100      * a noticeable performance improvement for entity enclosing requests
101      * (such as POST and PUT) that require the target server's
102      * authentication.
103      * </p>
104      *
105      * <p>
106      * 'Expect: 100-continue' handshake should be used with
107      * caution, as it may cause problems with HTTP servers and
108      * proxies that do not support HTTP/1.1 protocol.
109      * </p>
110      *
111      * This parameter expects a value of type {@link Boolean}.
112      */
113     public static final String USE_EXPECT_CONTINUE = "http.protocol.expect-continue";
114 
115     /**
116      * <p>
117      * Defines the maximum period of time in milliseconds the client should spend
118      * waiting for a 100-continue response.
119      * </p>
120      *
121      * This parameter expects a value of type {@link Integer}.
122      */
123     public static final String WAIT_FOR_CONTINUE = "http.protocol.wait-for-continue";
124 
125     /**
126      * <p>
127      * Defines the action to perform upon receiving a malformed input. If the input byte sequence
128      * is not legal for this charset then the input is said to be malformed
129      * </p>
130      *
131      * This parameter expects a value of type {@link java.nio.charset.CodingErrorAction}
132      *
133      * @since 4.2
134      */
135     public static final String HTTP_MALFORMED_INPUT_ACTION = "http.malformed.input.action";
136 
137     /**
138      * <p>
139      * Defines the action to perform upon receiving an unmappable input. If the input byte sequence
140      * is legal but cannot be mapped to a valid Unicode character then the input is said to be
141      * unmappable
142      * </p>
143      *
144      * This parameter expects a value of type {@link java.nio.charset.CodingErrorAction}
145      *
146      * @since 4.2
147      */
148     public static final String HTTP_UNMAPPABLE_INPUT_ACTION = "http.unmappable.input.action";
149 
150 }