Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Better API Clients

Better API Clients

More Decks by API Strategy & Practice Conference

Other Decks in Technology

Transcript

  1. /** The server address to use for accessing any resources.

    Default value: "cdn.contentful.com" */ @property (nonatomic) NSString* server; /** Configure a custom user-agent to be used in the HTTP request headers */ @property (nonatomic) NSString* userAgent;
  2. ▸ Offers us to create a question ▸ We can

    fill in the form we get ▸ Submit the form
  3. SIREN LINK { "entities": [ { "links": [ { "rel":

    ["self"], "href": "questions/1/choices/1" } ], "rel": ["choices"], "properties": { "choice": "Swift", "votes": 22 } } ] }
  4. SIREN ACTION { "actions": { "create": { "href": "/questions", "method":

    "POST", "fields": [ { "name": "question" }, { "name": "choices" } ], "type": "application/x-www-form-urlencoded" } } }
  5. ATTRIBUTES OF A TRANSITION if let transition = representor.transitions["create"] {

    transition.method transition.uri transition.suggestedContentType }
  6. WHAT HAVE WE LEARNED? ▸ Publish source code! ▸ Document!

    ▸ Test! ▸ Be robust against change!