Skip to Content
API Design Patterns
book

API Design Patterns

by John J. Geewax
July 2021
Intermediate to advanced
480 pages
14h 40m
English
Manning Publications
Content preview from API Design Patterns

27 Request validation

This chapter covers

  • Why some API methods should support pre-request validation
  • How to manage interactions with external dependencies for validation requests
  • Addressing special side effects for methods in validation requests

APIs can be confusing. Sometimes they can be confusing to the point where it’s unclear what a result will be for a given API call. For safe methods, we have a simple solution to figure out the result: just give it a try. For unsafe methods, though, that solution will obviously not work. In this pattern, we’ll explore a special validateOnly field we can add to request interfaces, which will act as a mechanism by which we can see what would have happened if the request was executed, without actually ...

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: 9781617295850Publisher SupportOtherPublisher WebsiteErrata PagePurchase Link