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

9 Custom methods

This chapter covers

  • Why standard methods can’t cover all possible scenarios
  • Using custom methods for cases where side effects are necessary
  • How to use stateless custom methods for computation-focused API methods
  • Determining the target for a custom method (resource versus collection)

Often, there will be actions we need to perform on our API resources that won’t fit nicely into one of the standard methods. And while these behaviors could technically be handled by the resource’s standard update method, the behavioral requirements of many of these operations would be quite out of place for a standard method, leading to a surprising, confusing, and overly complex interface. To address this, this pattern explores how to safely ...

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