You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2017/03/27 01:21:35 UTC
[25/37] incubator-juneau-website git commit: Update javadocs
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/236aea45/content/site/apidocs/org/apache/juneau/rest/client/package-summary.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/org/apache/juneau/rest/client/package-summary.html b/content/site/apidocs/org/apache/juneau/rest/client/package-summary.html
index 318648c..70841c0 100644
--- a/content/site/apidocs/org/apache/juneau/rest/client/package-summary.html
+++ b/content/site/apidocs/org/apache/juneau/rest/client/package-summary.html
@@ -273,6 +273,7 @@
</ol>
<li><p><a class='doclink' href='#ResponsePatterns'>Using Response Patterns</a></p>
<li><p><a class='doclink' href='#PipingOutput'>Piping Response Output</a></p>
+ <li><p><a class='doclink' href='#Debugging'>Debugging</a></p>
<li><p><a class='doclink' href='#Logging'>Logging</a></p>
<li><p><a class='doclink' href='#Interceptors'>Interceptors</a></p>
<li><p><a class='doclink' href='#Remoteable'>Remoteable Proxies</a></p>
@@ -829,8 +830,65 @@
</div>
<!-- ======================================================================================================== -->
+ <a id="Debugging"></a>
+ <h3 class='topic' onclick='toggle(this)'>1.5 - Debugging</h3>
+ <div class='topic'>
+ <p>
+ Use the <a href="../../../../../org/apache/juneau/rest/client/RestClientBuilder.html#debug-boolean-"><code>RestClientBuilder.debug(boolean)</code></a> method to enable logging for HTTP requests
+ made from the client.
+ </p>
+ <p>
+ Under-the-covers, this is simply a shortcut for adding the <a href="../../../../../org/apache/juneau/rest/client/RestCallLogger.html#DEFAULT"><code>RestCallLogger.DEFAULT</code></a> interceptor
+ to the client. This causes the following output to be generated by the Java <code>org.apache.juneau.rest.client</code> logger at <jsf>WARNING</jsf>
+ level:
+ </p>
+ <p class='bcode'>
+ === HTTP Call (outgoing) =======================================================
+ === REQUEST ===
+ POST http://localhost:10000/testUrl HTTP/1.1
+ ---request headers---
+ Debug: true
+ No-Trace: true
+ Accept: application/json
+ ---request entity---
+ Content-Type: application/json
+ ---request content---
+ {"foo":"bar","baz":123}
+ === RESPONSE ===
+ HTTP/1.1 200 OK
+ ---response headers---
+ Content-Type: application/json;charset=utf-8
+ Content-Length: 21
+ Server: Jetty(8.1.0.v20120127)
+ ---response content---
+ {"message":"OK then"}
+ === END ========================================================================
+ </p>
+ <p>
+ This setting also causes a <code>Debug: true</code> header value to trigger logging of the request on the server side as well.
+ </p>
+ <p class='bcode'>
+ === HTTP Request (incoming) ====================================================
+ HTTP POST /testUrl
+ ---Headers---
+ Host: localhost:10000
+ Transfer-Encoding: chunked
+ Accept: application/json
+ Content-Type: application/json
+ User-Agent: Apache-HttpClient/4.5 (Java/1.6.0_65)
+ Connection: keep-alive
+ Debug: true
+ Accept-Encoding: gzip,deflate
+ ---Default Servlet Headers---
+ ---Body---
+ {"foo":"bar","baz":123}
+ === END ========================================================================
+ </p>
+ </div>
+
+ <!-- ======================================================================================================== -->
<a id="Logging"></a>
- <h3 class='topic' onclick='toggle(this)'>1.5 - Logging</h3>
+ <h3 class='topic' onclick='toggle(this)'>1.6 - Logging</h3>
<div class='topic'>
<p>
Use the <a href="../../../../../org/apache/juneau/rest/client/RestClientBuilder.html#logTo-java.util.logging.Level-java.util.logging.Logger-"><code>RestClientBuilder.logTo(Level,Logger)</code></a> and <a href="../../../../../org/apache/juneau/rest/client/RestCall.html#logTo-java.util.logging.Level-java.util.logging.Logger-"><code>RestCall.logTo(Level,Logger)</code></a> methods
@@ -853,7 +911,7 @@
<!-- ======================================================================================================== -->
<a id="Interceptors"></a>
- <h3 class='topic' onclick='toggle(this)'>1.6 - Interceptors</h3>
+ <h3 class='topic' onclick='toggle(this)'>1.7 - Interceptors</h3>
<div class='topic'>
<p>
The <a href="../../../../../org/apache/juneau/rest/client/RestClientBuilder.html#interceptor-org.apache.juneau.rest.client.RestCallInterceptor-"><code>RestClientBuilder.interceptor(RestCallInterceptor)</code></a> and <a href="../../../../../org/apache/juneau/rest/client/RestCall.html#interceptor-org.apache.juneau.rest.client.RestCallInterceptor-"><code>RestCall.interceptor(RestCallInterceptor)</code></a> methods
@@ -909,7 +967,7 @@
HttpUriRequest req = restCall.getRequest();
HttpResponse res = restCall.getResponse();
<jk>if</jk> (req != <jk>null</jk>) {
- sb.append(<js>"\n=== HTTP Call =================================================================="</js>);
+ sb.append(<js>"\n=== HTTP Call (outgoing) ========================================================="</js>);
sb.append(<js>"\n=== REQUEST ===\n"</js>).append(req);
sb.append(<js>"\n---request headers---"</js>);
@@ -956,7 +1014,7 @@
<!-- ======================================================================================================== -->
<a id="Remoteable"></a>
- <h3 class='topic' onclick='toggle(this)'>1.7 - Remotable Proxies</h3>
+ <h3 class='topic' onclick='toggle(this)'>1.8 - Remotable Proxies</h3>
<div class='topic'>
<p>
Juneau provides the capability of calling methods on POJOs on a server through client-side proxy interfaces.
@@ -1018,7 +1076,7 @@
<!-- ======================================================================================================== -->
<a id="Other"></a>
- <h3 class='topic' onclick='toggle(this)'>1.8 - Other Useful Methods</h3>
+ <h3 class='topic' onclick='toggle(this)'>1.9 - Other Useful Methods</h3>
<div class='topic'>
<p>
The <a href="../../../../../org/apache/juneau/rest/client/RestClientBuilder.html#rootUrl-java.lang.Object-"><code>RestClientBuilder.rootUrl(Object)</code></a> method can be used to specify a root URL on