IntroductionThe TRACE method is primarily used for debugging and testing purposes, and simply requests that the server echo back the request it received. This can be useful for identifying any changes to the request that is made by proxies. The TRACE method is used to invoke a remote, application-layer loop-back of the request message. The final recipient of the request should reflect the message received back to the client as the entity-body of a 200 (OK) response. The final recipient is either the origin server or the first proxy or gateway to receive a max-Forwards value of zero (0) in the request (see section 14.31 of RFC2616). Typical UsageThe trace method simply requires providing a URL and reading the
response received. Additional headers can be added with the
TraceMethod trace = new TraceMethod("http://jakarata.apache.org"); // Execute the method and handle any errors. ... // Read the response body. String request = trace.getResponseBodyAsString(); trace.releaseConnection(); Common ProblemsNone. RFC SectionThe trace method is defined in section 9.6 of RFC2616. |