1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package org.apache.commons.httpclient.methods;
31
32 import org.apache.commons.httpclient.HttpMethodBase;
33
34 /***
35 * Implements the HTTP TRACE method.
36 * <p>
37 * The HTTP TRACE method is defined in section 9.6 of
38 * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
39 * <blockquote>
40 * The TRACE method is used to invoke a remote, application-layer loop-
41 * back of the request message. The final recipient of the request
42 * SHOULD reflect the message received back to the client as the
43 * entity-body of a 200 (OK) response. The final recipient is either the
44 * origin server or the first proxy or gateway to receive a Max-Forwards
45 * value of zero (0) in the request (see section 14.31). A TRACE request
46 * MUST NOT include an entity.
47 * </blockquote>
48 * </p>
49 *
50 * @author Sean C. Sullivan
51 * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
52 * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
53 *
54 * @version $Revision: 155418 $
55 * @since 2.0
56 *
57 */
58 public class TraceMethod extends HttpMethodBase {
59
60
61
62 /***
63 * Constructor specifying a URI.
64 *
65 * @param uri either an absolute or relative URI
66 *
67 * @since 2.0
68 *
69 */
70 public TraceMethod(String uri) {
71 super(uri);
72 setFollowRedirects(false);
73 }
74
75
76
77 /***
78 * Returns <tt>"TRACE"</tt>.
79 *
80 * @return <tt>"TRACE"</tt>
81 *
82 * @since 2.0
83 *
84 */
85 public String getName() {
86 return "TRACE";
87 }
88
89 /***
90 * Recycles the HTTP method so that it can be used again.
91 * Note that all of the instance variables will be reset
92 * once this method has been called. This method will also
93 * release the connection being used by this HTTP method.
94 *
95 * @see #releaseConnection()
96 *
97 * @since 2.0
98 *
99 * @deprecated no longer supported and will be removed in the future
100 * version of HttpClient
101 */
102 public void recycle() {
103 super.recycle();
104 setFollowRedirects(false);
105 }
106
107 }