| <!-- |
| /*************************************************************************************************************************** |
| * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations under the License. |
| ***************************************************************************************************************************/ |
| --> |
| |
| Debugging |
| |
| <p> |
| Use the {@link oajrc.RestClientBuilder#debug()} method to enable logging for HTTP requests |
| made from the client. |
| </p> |
| <p> |
| Under-the-covers, this is simply a shortcut for adding the {@link oajrc.RestCallLogger#DEFAULT} |
| interceptor to the client. |
| This causes the following output to be generated by the Java <c>org.apache.juneau.rest.client</c> |
| logger at <jsf>WARNING</jsf> level: |
| </p> |
| <p class='bpcode w800 console'> |
| === 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 <c>Debug: true</c> header value to trigger logging of the request on the |
| server side as well. |
| </p> |
| <p class='bpcode w800 console'> |
| === 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> |