.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ========= EXT: tail ========= :Created: 2013-04-09T09:53:23 :Changed: 2014-03-07T14:19:12.541000000 :Classification: tail :Keywords: REST, rest, tail, restful, client, forDevelopers, forIntermediates :Author: Pascal Dürsteler :Email: welcome@notionlab.ch :Language: en .. _img-1-img-2-EXT-tail: |img-1| |img-2| EXT: tail ========================= Extension Key: tailLanguage: enKeywords: REST, rest, tail, restful, client, forDevelopers, forIntermediatesCopyright 2014, Pascal Dürsteler, `_ >This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- **`EXT: tail 1 <#__RefHeading__5708_1738894311>`_** **`Introduction 3 <#__RefHeading__5710_1738894311>`_** `What does it do? 3 <#__RefHeading__463_413120346>`_ **`Users manual 4 <#__RefHeading__467_413120346>`_** **`Known problems 5 <#__RefHeading__31525_818911409>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ Tail is a minimalistic service library built on top of cUrl to interact with APIs. Since I wanted to keep it simple and based on the current features required, It currently just supports REST requests. Tail does not (yet) use namespaces to be compatible with php5.2. It aims to integrate well with the TYPO3 core, that's why I havent just copied some existing framework. .. _Users-manual: Users manual ------------ :: // Prepare and execute a GET request $response = $client->get('path/to/resource')->send(); // Check the response if ($response->isSuccess()) { // Get the JSON body as array $data = $response->responseBody()->fromJSON(); // Or handle it by yourself: $raw_data = $response->responseBody()->raw(); } else { // Whops, something went wrong echo $response->status; // Display header for debugging purpose print_r($response->responseHeader()->data()); } // You can also chain calls $data = $client->get('path/to/resource.xml')->send()->responseBody()->fromXML(); // Add some custom headers for one request $client->get('path/to/resource', array('X-My-Header: Custom'))->send(); // Doing a POST $client->post('path/to/resource', array('key' => 'value'))->send(); // Of course, you can also PUT $client->put('path/to/resource', attay('key' => 'value'))->send(); // or DELETE $client->delete('path/to/resource')->send(); .. _Known-problems: Known problems -------------- Currently none. Please report bugs at the project's forge page. `Tail on forge.typo3.org `_ .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 44 .. :id: graphics5 .. :name: graphics5 .. :vspace: 57 .. :width: 161 .. |img-2| image:: img-2.png .. :align: left