You are on page 1of 8

PRACTICAL API DEBUGGING

WITH TELERIK FIDDLER


for REST/SOAP APIs and distributed client/server applications
version 1.0 - july 2014
Edoardo Nosotti

edoardonosotti.info
@EdoNosotti

THE PROBLEM

INSPECT
DEBUG

We need to inspect client requests and server responses over HTTP


and debug the server side code. The client application code is not
accessible or we cannot change the API endpoint URL.

THE SOLUTION

Run a local, debuggable instance


of the server application and use
Telerik Fiddler to redirect
network connections and inspect
sessions.

LOCALHOST
SERVER

STEP BY STEP
1.

Download and install the latest version of Fiddler from


Telerik (http://www.telerik.com/download/fiddler,
currently free and version 4.4.8.0)

2.

In Fiddler, go to Tools > Fiddler Options >


Connections and check the proxy port it is listening to
(check the Fiddler listens on port field)

3.

Find your machine IP either by running ipconfig from


the command line or hovering on the Online label in
the top right corner of the Fiddler window

STEP BY STEP
4.

Setup your client device to use the fiddler proxy


(listening on your machine IP as described in step
#3 on the Fiddlers port as described in step #4)

5.

In Fiddler, go to Rules > Customize Rules, find the


OnBeforeRequest function and modify it as shown
in the following examples
Some operating systems (like Android) only allow proxies for web traffic and will skip
proxy settings for apps. You will probably need to gain root privileges on the device to
proxy all network traffic or install some third party tools.

STEP BY STEP

These are two examples of the same script, do not add them both to the rules script!

READY!
Run the server instance and the client application, if your setup is correct, you will be able
to see HTTP traffic in the Fiddler inspector window and see requests coming to the server.

REQUEST

SESSIONS
RESPONSE

MISSION ACCOMPLISHED
THANK YOU!
for more articles and tips
http://www.slideshare.net/edoardonosotti
http://edoardonosotti.info
follow me on twitter
@EdoNosotti
Special thanks to Telerik for releasing Fiddler for free, to OpenClipart.org and its artists for the nice, public domain
graphics, to SlideShare for hosting a lot of useful documentation and to all the people who shared their knowledge with
me over the years and those who support me every day.
All trademarks are property of their respective owners.

You might also like