Testing the Webapi interface with fiddler

Source: Internet
Author: User
Tags clear screen

Fiddler is one of the easy-to-use WEBAPI debugging tools that can record HTTP and HTTPS requests from all clients and servers, allow you to monitor, set breakpoints, and even modify input and output data, Fiddler in the form of a proxy Web server, The use of Fiddler is a great help both for development and for testing.

Fiddler is a free HTTP debugging agent software developed by the C # language, Fiddler can record all the HTTP communication between your computer and the Internet, Fiddler can also let you check all HTTP communication, set breakpoints

First, fiddler basic interface

Second, the information of the session request list is respectively

1. Results (Result)

2. Agreement (PROTOCOL)

3. Hostname (host)

4. Web address (URL)

5. Content Size (Body)

6. Cache (Caching)

7. HTTP content Type of response (Content-type)

8. The program that the request runs (process)

9. Notes (Comments)

10. Customization (Custom)

Third, the use of quickexec command line

There is a command-line tool called Quickexec, which allows you to enter commands directly in the lower-left corner of the Fiddler (that is, labeled 7).

Common commands are:

1, help open the official Use page introduction, all the commands will be listed to

2, CLS clear screen (Ctrl+x can also clear the screen)

3. Select the command for the session

4 、?. PNG to select a PNG suffix picture

5. Bpu Intercept Request

Iv. Data Lookup Area Statistics tab

By displaying all of the HTTP traffic, fiddler can easily show you which files generate the page you are currently requesting.  With the Statistics tab, the user can select multiple sessions to get the total information statistics for these sessions, such as multiple requests and bytes transferred. Select the first request and the last request to get the overall time consumed by the entire page load. You can also separate which requests take the most time from the bar chart to optimize access to the page

V. Testing the WebAPI Get method

Execute execution Result:

The Get method queries a single

Six, test WebAPI post method

In the request header plus:

Accept:application/xml

Content-type:application/json

Seven, test WebAPI put method

Viii. Test WebAPI Delete method

Ix. fiddler How to capture HTTPS sessions

1, by default, Fiddler will not capture HTTPS session, need you set, open Fiddler tool->fiddler options->https tab

2, pop up the following dialog box, click "YES"

3. Eject the Security Warning box and continue clicking "YES"

How to use fiddler when you debug a Web site vs.

When developing an ASP with Visual Stuido, you also need to use Fiddler to analyze HTTP, and by default fiddler is not able to sniff localhost's web site. But if you add a dot behind localhost, fiddler can sniff.

For example:

Originally the address of the ASP. NET is http://localhost:2391/Default.aspx, add a dot number, become http://localhost.:2391/Default.aspx will be able

Testing the Webapi interface with fiddler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.