What is the difference between RESTful and non-RESTful APIs?

Answer

A RESTful API adheres to REST's six architectural constraints — stateless, client-server, cacheable, uniform interface, layered system — and uses standard HTTP methods and status codes correctly. Resources are identified by URLs, operations are performed via HTTP verbs, and responses use standard media types (JSON, XML). A non-RESTful API (sometimes called RPC-style or REST-ish) may use HTTP as a transport but violates REST principles. Common violations include: using verbs in URLs (/getUser), using POST for all operations, returning 200 for errors, storing state on the server, or ignoring HTTP semantics. XML-RPC and SOAP are technically non-RESTful. GraphQL and gRPC are explicitly not REST — they are different paradigms. Most real-world APIs are pragmatic and not perfectly RESTful.