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