Sivaram Rasathurai
2 min readJan 29, 2025

--

I appreciate your perspective!, Many APIs today follow more of an RPC-style approach rather than strict REST principles, and JSON itself isn’t inherently a hypermedia resource.

However, REST, as originally defined by Roy Fielding, emphasizes statelessness, cacheability, and the uniform interface, which is why using GET for retrieval is recommended. That said, I agree that in practice, many APIs use POST for complex queries when query parameters aren’t sufficient

The goal of my article was to highlight both the theoretical principles and real-world considerations. I’m always open to refining the discussion—thanks for sharing your thoughts!

1. REST and RPC Distinction

While it's true that many modern APIs resemble RPC due to function-like endpoints, REST principles are more about resource-oriented design and leveraging standard HTTP methods (GET, POST, PUT, DELETE) .

Just because an API uses JSON or supports complex queries doesn’t automatically classify it as RPC.

REST is a flexible architectural style, and many implementations lie on a spectrum rather than adhering strictly to Fielding's original vision.

2. Using POST for Complex Queries

You’re correct & I've already mentioned in this article that POST can be appropriate for search endpoints in cases where query parameters exceed practical URL length limits or involve sensitive data.

However, REST principles encourage GET for data retrieval due to its inherent benefits, like cacheability and idempotency.

By switching to POST unnecessarily, these benefits are forfeited, which can lead to inefficiencies in caching and debugging.

3. Representation of Resources

JSON is a widely accepted and valid representation format in RESTful APIs. While hypermedia (HATEOAS) was part of REST’s original definition, most modern APIs do not implement it strictly, yet they are still RESTful.

Dismissing JSON as a valid resource representation oversimplifies the broader understanding of REST today.

4."Blatant Purity" in REST

JSON is a widely accepted and valid representation format in RESTful APIs. While hypermedia (HATEOAS) was part of REST’s original definition, most modern APIs do not implement it strictly, yet they are still RESTful. Dismissing JSON as a valid resource representation oversimplifies the broader understanding of REST today.

--

--

Responses (1)