Monday, December 22, 2014

Using Fiddler to test your ASP.NET Web API application

If you are developing an ASP.NET Web API application, you may want to be able to periodically test your ASP.NET Web API client without writing a Web Page and some JavaScript.

Fortunately, you can do just that using Telerik Fiddler which can be downloaded from here:

You basically just use the Fiddler Composer to compose your JSON requests to your Web API endpoints in the Request Body:

So how do you figure out how to properly compose the Request Body using JSON?

Well, fortunately, with Web API 2, you can use the /help feature to view all of your ASP.NET Web API routes/endpoints.

If you then click on the hyperlink to one of your routes, you will be able to see a sample of how to compose a JSON Request to send to your Web API Service.  You can then use Fiddler to choose the appropriate GET, PUT, POST, PATCH or DELETE response and view the resultant JSON!!

How neat is that??

No comments:

Post a Comment