Skip to Content
Design and Build Great Web APIs
book

Design and Build Great Web APIs

by Mike Amundsen
October 2020
Intermediate to advanced
358 pages
8h 39m
English
Pragmatic Bookshelf
Content preview from Design and Build Great Web APIs

Testing with SRTs

An easy way to start testing your API is to focus just on the interface itself with what I call simple request tests, or SRTs. SRTs are just what the name sounds like: a simple HTTP request you can run to validate that the minimal elements of the API are working as you would expect. And that’s how I use SRTs—to validate the API.

Here are a few examples of SRTs used for testing an API that supports managing people’s contact information:

 # person api test requests
 # 2020-02 mamund
 
 http://localhost:8181/
 http://localhost:8181/list/
 http://localhost:8181/filter?status=active
 http://localhost:8181/ -X POST -d \
  id=q1w2e3r4&status=pending&email=test@example.org
 http://localhost:8181/q1w2e3r4 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing Web APIs

Designing Web APIs

Brenda Jin, Saurabh Sahni, Amir Shevat

Publisher Resources

ISBN: 9781680508123Errata Page