Secrets to Debugging Network Traffic

As many of you know, I am Java Programmer and a cURL fan. When I am demonstrating an API to a customer or another IBMer, I tend to default to either method to demonstrate the API.

I was demonstrating a download API that was being redirected, and throwing an error on a different Node.  In order to debug the traffic, I used a couple of different methods.

1 – For Java

I added  to the Java VM Arguments.  In Eclipse, I configure the Run Configuration -> VM Arguments.

java  MyAPIDemo

I absolutely make sure you have enough buffer in your console window.  I right click and update to a 100,000 lines.  I like to keep it as high as possible to capture all the details.

Scroll Through the output and find out what actually happened in the request.

2 – For cURL

I add -vv which is super verbose to the command

curl -H "Authorization: Basic asdfljkfasdf" -vv

I read through and find out why my API failed.

You can read more about the configuration in the IBM JDK Documentation.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.