Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

RequestSpec Example

A practical, real-world example showing how to build a complete networking layer using RequestSpec.

What This Does

This example connects to JSONPlaceholder (a free fake REST API) and demonstrates all the common patterns you'll need when building your own API clients.

What's Inside

  • Complete API coverage for 6 resources (Posts, Comments, Albums, Photos, Todos, Users)
  • 24+ working examples covering all HTTP methods
  • Clean architecture with protocols, services, and models
  • Detailed documentation with inline comments and explanations

How to Run

cd Examples/RequestSpecExample
swift run

That's it! The example will execute all API calls and print the results.

Quick Start

Open RequestSpecExample.swift and explore:

  • Lines ~120-395: Example demonstrations
  • Lines ~395-590: Service layer architecture
  • Lines ~810+: RequestSpec definitions (the good stuff!)

Each request is documented with what it does and why. Perfect for learning by example!

Don't forget to check the request definitions at the bottom to see RequestSpec in action!