api/v1/things
⇒ list of all thingsapi/v1/things/<id>
⇒ the thing with id of <id>api/v1/things/<id>/subthings
⇒ a things's subthingsapi/v1/thing/<id>/subthings/<id>
⇒ one of thing's subthingsapi/v1/search?q=thing+to+search+for&foo=other+thing
Send URL and METHOD.
Extra data for POST and PUT is sent in headers. Query params (e.g., for search) as query params.
Receive request if URL not found format error message as json send message with code 401 exit route to handler Handler: if GET Get query data (if any) get the requested data format and encode as json send message with return code 200 else if POST get header data (if any) get query data (if any) create new resource (in DB or whatever) format and encode new resource data as json (?) send message with return code TODO else if PUT get header data (if any) get query data (if any) get resource (from DB or whatever) update resource (in model) rewrite resource (to DB or whatever) format and encode new resource data as json (?) send message with return code TODO else if DELETE get query data (if any) delete resource (in DB or whatever) format and encode (what?) as json send message with return code TODO on error format error message as json send message with code TODO