Get started with wiretap

Value in 45 seconds, or your money back.

Don’t have time to read? Just want to try things out? No problem, we’ve got you covered.

1. Install wiretap

brew install pb33f/taps/wiretap If you don’t/can’t use homebrew, then you can use one of the other methods of installing wiretap

2. Download OpenAPI spec

We’re going to use a small example Gift Shop OpenAPI specification to demonstrate the speed and power of wiretap.

curl -o giftshop-openapi.yaml https://api.pb33f.io/wiretap/giftshop-openapi.yaml

3. Run wiretap

wiretap -s giftshop-openapi.yaml -u https://api.pb33f.io

You should see something like this appear in your terminal.

console screenshot of wiretap
wiretap console running example command.

4. Open the wiretap monitor

Open up your browser and point it at http://localhost:9091,and you should see the wiretap monitor.

Screenshot of wiretap monitor
wiretap monitor running on default port 9091.

5. Make API request

Use curl to make a request to the giftshop API via wiretap

curl "http://localhost:9090/wiretap/giftshop/products"
Screenshot of console running curl get command
Making a valid API command to giftshop.

6. Explore the request

You should be able to see, click-on and explore that request in your wiretap monitor.

screenshot of the monitor showing a valid request
A valid request shown in the monitor.

7. Make an invalid API request

Use curl to make an invalid request to the pb33f giftshop to create a new product via wiretap

curl -s -X POST "http://localhost:9090/wiretap/giftshop/products" \ -H "X-API-Key: abc1234" \ -d '{"invalid":"json"}'

This request is invalid, because we’re making a POST request with the wrong content type. The API is expecting application/json and we’re sending application/x-www-form-urlencoded.

Screenshot of console running curl post command
Making an invalid API request to pb33f giftstore.

8. Explore the invalid request

You should be able to see, click-on and explore that invalid request in your wiretap monitor.

The violation is marked pretty clearly.

screenshot of the monitor showing an invalid request
An invalid request shown in the monitor.

9. Make another invalid API request

Use curl to make another invalid request to the giftshop via wiretap

curl -s -X POST "http://localhost:9090/wiretap/giftshop/products" \ -H 'Content-Type: application/json' \ -H "X-API-Key: abc1234" \ -d '{"invalid":"json"}'

This request is invalid because even though we’re sending the right content-type, we’re sending the wrong object, the schema is incorrect

screenshot of the monitor showing another invalid request
Another invalid request shown in the monitor.

Clicking on the violation allows the exploration of what went wrong and why the schema is incorrect, and what the schema should be.


What’s next?

You should now have a good idea of what wiretap can do for you, however there is a lot more to discover.

Why not learn about wiretap so you can learn more its features and capabilities.

Read more about the pb33f example Giftshop API that we used in this quickstart.