HTTP Client library

Dependents:   weather_LCD_display News_LCD_display TwitterExample_1 GeoLocation_LCD_Display ... more

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Thu Aug 05 15:09:46 2010 +0000
Parent:
4:76ca2a4fa528
Child:
6:3d3824893be1
Commit message:

Changed in this revision

LPC1768/HTTPClient.ar Show annotated file Show diff for this revision Revisions of this file
LPC1768/dbg/dbg.h Show annotated file Show diff for this revision Revisions of this file
LPC1768/services/http/client/HTTPClient.h Show annotated file Show diff for this revision Revisions of this file
LPC1768/services/http/client/HTTPData.h Show annotated file Show diff for this revision Revisions of this file
LPC1768/services/http/client/data/HTTPFile.h Show annotated file Show diff for this revision Revisions of this file
LPC1768/services/http/client/data/HTTPMap.h Show annotated file Show diff for this revision Revisions of this file
LPC1768/services/http/client/data/HTTPStream.h Show annotated file Show diff for this revision Revisions of this file
LPC1768/services/http/client/data/HTTPText.h Show annotated file Show diff for this revision Revisions of this file
LPC1768/services/http/util/url.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/HTTPClient.ar Show annotated file Show diff for this revision Revisions of this file
LPC2368/dbg/dbg.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/services/http/client/HTTPClient.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/services/http/client/HTTPData.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/services/http/client/data/HTTPFile.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/services/http/client/data/HTTPMap.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/services/http/client/data/HTTPStream.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/services/http/client/data/HTTPText.h Show annotated file Show diff for this revision Revisions of this file
LPC2368/services/http/util/url.h Show annotated file Show diff for this revision Revisions of this file
Binary file LPC1768/HTTPClient.ar has changed
--- a/LPC1768/dbg/dbg.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/dbg/dbg.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,6 +21,10 @@
 THE SOFTWARE.
 */
 
+/** \file
+Debugging helpers header file
+*/
+
 //#ifdef DBG_H
 //#define DBG_H
 
@@ -28,6 +32,11 @@
 #define __DEBUG
 #endif
 
+/*!
+  \def __DEBUG
+  To define to enable debugging in one file
+*/
+
 #ifdef __DEBUG
 
 #ifndef __DEBUGSTREAM
@@ -47,8 +56,15 @@
 #undef DBG
 #undef DBG_END
 #undef BREAK
+
+///Debug output (if enabled), same syntax as printf, with heading info
 #define DBG(...) do{ DebugStream::debug("[%s:%s@%d] ", __FILE__, __FUNCTION__, __LINE__); DebugStream::debug(__VA_ARGS__); } while(0);
+
+///Debug output (if enabled), same syntax as printf, no heading info
+#define DBGL(...) do{ DebugStream::debug(__VA_ARGS__); } while(0);
 #define DBG_END DebugStream::release
+
+///Break point usin serial debug interface (if debug enbaled)
 #define BREAK() DebugStream::breakPoint(__FILE__, __LINE__)
 #endif
 
--- a/LPC1768/services/http/client/HTTPClient.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/services/http/client/HTTPClient.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,12 +21,16 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP Client header file
+*/
+
 #ifndef HTTP_CLIENT_H
 #define HTTP_CLIENT_H
 
 class HTTPData;
 
-#include "if/net/net.h"
+#include "core/net.h"
 #include "api/TCPSocket.h"
 #include "api/DNSRequest.h"
 #include "HTTPData.h"
@@ -38,33 +42,68 @@
 #include <map>
 using std::map;
 
+///HTTP client results
 enum HTTPResult
 {
-  HTTP_OK,
-  HTTP_PROCESSING,
-  HTTP_PARSE, //URI Parse error
-  HTTP_DNS, //Could not resolve name
-  HTTP_PRTCL, //Protocol error
-  HTTP_NOTFOUND, //404 Error
-  HTTP_REFUSED, //403 Error
-  HTTP_ERROR, //xxx error
-  HTTP_TIMEOUT, //Connection timeout
-  HTTP_CONN //Connection error
+  HTTP_OK, ///<Success
+  HTTP_PROCESSING, ///<Processing
+  HTTP_PARSE, ///<URI Parse error
+  HTTP_DNS, ///<Could not resolve name
+  HTTP_PRTCL, ///<Protocol error
+  HTTP_NOTFOUND, ///<HTTP 404 Error
+  HTTP_REFUSED, ///<HTTP 403 Error
+  HTTP_ERROR, ///<HTTP xxx error
+  HTTP_TIMEOUT, ///<Connection timeout
+  HTTP_CONN ///<Connection error
 };
 
+#include "core/netservice.h"
 
-
+///A simple HTTP Client
+/**
+The HTTPClient is composed of:
+- The actual client (HTTPClient)
+- Classes that act as a data repository, each of which deriving from the HTTPData class (HTTPText for short text content, HTTPFile for file I/O, HTTPMap for key/value pairs, and HTTPStream for streaming purposes)
+*/
 class HTTPClient : protected NetService
 {
 public:
+  ///Instantiates the HTTP client
   HTTPClient();
   virtual ~HTTPClient();
   
+  ///Provides a basic authentification feature (Base64 encoded username and password)
   void basicAuth(const char* user, const char* password); //Basic Authentification
   
   //High Level setup functions
+  ///Executes a GET Request (blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  Blocks until completion
+  */
   HTTPResult get(const char* uri, HTTPData* pDataIn); //Blocking
+  
+  ///Executes a GET Request (non blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pMethod : callback function
+  The function returns immediately and calls the callback on completion or error
+  */
   HTTPResult get(const char* uri, HTTPData* pDataIn, void (*pMethod)(HTTPResult)); //Non blocking
+  
+  ///Executes a GET Request (non blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pItem : instance of class on which to execute the callback method
+  @param pMethod : callback method
+  The function returns immediately and calls the callback on completion or error
+  */
   template<class T> 
   HTTPResult get(const char* uri, HTTPData* pDataIn, T* pItem, void (T::*pMethod)(HTTPResult)) //Non blocking
   {
@@ -73,8 +112,37 @@
     return HTTP_PROCESSING;
   }
   
+  ///Executes a POST Request (blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  Blocks until completion
+  */
   HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn); //Blocking
+  
+  ///Executes a POST Request (non blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pMethod : callback function
+  The function returns immediately and calls the callback on completion or error
+  */
   HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn, void (*pMethod)(HTTPResult)); //Non blocking
+  
+  ///Executes a POST Request (non blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pItem : instance of class on which to execute the callback method
+  @param pMethod : callback method
+  The function returns immediately and calls the callback on completion or error
+  */
   template<class T> 
   HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn, T* pItem, void (T::*pMethod)(HTTPResult)) //Non blocking  
   {
@@ -82,28 +150,68 @@
     doPost(uri, dataOut, pDataIn);
     return HTTP_PROCESSING;
   }
+
+  ///Executes a GET Request (non blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  The function returns immediately and calls the previously set callback on completion or error
+  */  
+  void doGet(const char* uri, HTTPData* pDataIn);  
   
-  void doGet(const char* uri, HTTPData* pDataIn);  
+  ///Executes a POST Request (non blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pMethod : callback function
+  The function returns immediately and calls the previously set callback on completion or error
+  */
   void doPost(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn); 
   
+  ///Setups the result callback
+  /**
+  @param pMethod : callback function
+  */
   void setOnResult( void (*pMethod)(HTTPResult) );
+  
+  ///Setups the result callback
+  /**
+  @param pItem : instance of class on which to execute the callback method
+  @param pMethod : callback method
+  */
   class CDummy;
   template<class T> 
-  //Linker bug : Must be defined here :(
   void setOnResult( T* pItem, void (T::*pMethod)(HTTPResult) )
   {
     m_pCb = NULL;
     m_pCbItem = (CDummy*) pItem;
     m_pCbMeth = (void (CDummy::*)(HTTPResult)) pMethod;
   }
-  
+
+  ///Setups timeout
+  /**
+  @param ms : time of connection inactivity in ms after which the request should timeout
+  */
   void setTimeout(int ms);
   
   virtual void poll(); //Called by NetServices
   
+  ///Gets last request's HTTP response code
+  /**
+  @return The HTTP response code of the last request
+  */
   int getHTTPResponseCode();
+  
+  ///Sets a specific request header
   void setRequestHeader(const string& header, const string& value);
+  
+  ///Gets a response header
   string& getResponseHeader(const string& header);
+  
+  ///Clears request headers
   void resetRequestHeaders();
   
 protected:
--- a/LPC1768/services/http/client/HTTPData.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/services/http/client/HTTPData.h	Thu Aug 05 15:09:46 2010 +0000
@@ -24,7 +24,7 @@
 #ifndef HTTP_DATA_H
 #define HTTP_DATA_H
 
-#include "if/net/net.h"
+#include "core/net.h"
 
 #include <string>
 using std::string;
--- a/LPC1768/services/http/client/data/HTTPFile.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/services/http/client/data/HTTPFile.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,18 +21,38 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP File data source/sink header file
+*/
+
 #ifndef HTTP_FILE_H
 #define HTTP_FILE_H
 
 #include "../HTTPData.h"
 #include "mbed.h"
 
+///HTTP Client data container for files
+/**
+This class provides file access/storage for HTTP requests and responses' data payloads.
+
+
+*/
 class HTTPFile : public HTTPData //Read or Write data from a file
 {
 public:
+  ///Instantiates data source/sink with file in param.
+  /**
+  Uses file at path @a path.
+  It will be opened when some data has to be read/written from/to it and closed when this operation is complete or on destruction of the instance.
+  Note that the file will be opened with mode "w" for writing and mode "r" for reading, so the file will be cleared between each request if you are using it for writing.
+  
+  @note
+  Note that to use this you must instantiate a proper file system (such as the LocalFileSystem or the SDFileSystem).
+  */
   HTTPFile(const char* path);
   virtual ~HTTPFile();
   
+  ///Forces file closure
   virtual void clear();
 
 protected:
--- a/LPC1768/services/http/client/data/HTTPMap.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/services/http/client/data/HTTPMap.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,6 +21,10 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP Map data source/sink header file
+*/
+
 #ifndef HTTP_MAP_H
 #define HTTP_MAP_H
 
@@ -32,15 +36,29 @@
 
 typedef map<string, string> Dictionary;
 
+///HTTP Client data container for key/value pairs
+/**
+This class simplifies the use of key/value pairs requests and responses used widely among web APIs.
+Note that HTTPMap inherits from std::map<std::string,std::string>.
+You can therefore use any public method of that class, including the square brackets operator ( [ ] ) to access a value.
+
+The data is encoded or decoded to/from a key/value pairs-formatted string, after url-encoding/decoding.
+*/
 class HTTPMap : public HTTPData, public Dictionary //Key/Value pairs
 {
 public:
+  ///Instantiates map
+  /**
+  @param keyValueSep Key/Value separator (defaults to "=")
+  @param pairSep Pairs separator (defaults to "&")
+  */
   HTTPMap(const string& keyValueSep = "=", const string& pairSep = "&");
   virtual ~HTTPMap();
   
  /* string& operator[](const string& key);
   int count();*/
 
+  ///Clears the content
   virtual void clear();  
   
 protected:
--- a/LPC1768/services/http/client/data/HTTPStream.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/services/http/client/data/HTTPStream.h	Thu Aug 05 15:09:46 2010 +0000
@@ -27,18 +27,36 @@
 #include "../HTTPData.h"
 #include "mbed.h"
 
+/** \file
+HTTP Stream data source/sink header file
+*/
+
 typedef uint8_t byte;
 
+///HTTP Client Streaming tool
+/**
+This class allows you to stream data from the web using a persisting HTTP connection.
+To use it properly you must use a non-blocking HTTPClient method.
+*/
 class HTTPStream : public HTTPData //Streaming buf
 {
 public:
+  ///Instantiates the object
   HTTPStream();
   virtual ~HTTPStream();
   
+  ///Starts to read into buffer
+  /**
+  Passes a buffer of address @a buf and size @a size to the instance.
+  When it receives data it will be stored in this buffer.
+  When the buffer is full it throttles the client until this function is called again.
+  */
   void readNext(byte* buf, int size);
   
+  ///Returns whether there is data available to read
   bool readable();
   
+  ///Returns the actual length of the payload written in the buffer
   int readLen();
   
   virtual void clear();
--- a/LPC1768/services/http/client/data/HTTPText.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/services/http/client/data/HTTPText.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,6 +21,10 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP Text data source/sink header file
+*/
+
 #ifndef HTTP_TEXT_H
 #define HTTP_TEXT_H
 
@@ -29,18 +33,50 @@
 
 #define DEFAULT_MAX_MEM_ALLOC 512 //Avoid out-of-memory problems
 
+///HTTP Client data container for text
+/**
+This is a simple "Text" data repository for HTTP requests.
+*/
 class HTTPText : public HTTPData //Simple Text I/O
 {
 public:
+  ///Instantiates the object.
+  /**
+  @param encoding encoding of the data, it defaults to text/html.
+  @param maxSize defines the maximum memory size that can be allocated by the object. It defaults to 512 bytes.
+  */
   HTTPText(const string& encoding = "text/html", int maxSize = DEFAULT_MAX_MEM_ALLOC);
   virtual ~HTTPText();
   
+  ///Gets text
+  /**
+  Returns the text in the container as a zero-terminated char*.
+  The array returned points to the internal buffer of the object and remains owned by the object.
+  */
   const char* gets() const;
+  
+  //Puts text
+  /**
+  Sets the text in the container using a zero-terminated char*.
+  */
   void puts(const char* str);
   
+  ///Gets text
+  /**
+  Returns the text in the container as string.
+  */
   string& get();
+  
+  ///Puts text
+  /**
+  Sets the text in the container as string.
+  */
   void set(const string& str);
   
+  ///Clears the content.
+  /**
+  If this container is used as a data sink, it is cleared by the HTTP Client at the beginning of the request.
+  */
   virtual void clear();
   
 protected:
--- a/LPC1768/services/http/util/url.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC1768/services/http/util/url.h	Thu Aug 05 15:09:46 2010 +0000
@@ -24,7 +24,7 @@
 #ifndef URL_H
 #define URL_H
 
-#include "if/net/ipaddr.h"
+#include "core/ipaddr.h"
 
 #include <string>
 using std::string;
Binary file LPC2368/HTTPClient.ar has changed
--- a/LPC2368/dbg/dbg.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/dbg/dbg.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,6 +21,10 @@
 THE SOFTWARE.
 */
 
+/** \file
+Debugging helpers header file
+*/
+
 //#ifdef DBG_H
 //#define DBG_H
 
@@ -28,6 +32,11 @@
 #define __DEBUG
 #endif
 
+/*!
+  \def __DEBUG
+  To define to enable debugging in one file
+*/
+
 #ifdef __DEBUG
 
 #ifndef __DEBUGSTREAM
@@ -47,8 +56,15 @@
 #undef DBG
 #undef DBG_END
 #undef BREAK
+
+///Debug output (if enabled), same syntax as printf, with heading info
 #define DBG(...) do{ DebugStream::debug("[%s:%s@%d] ", __FILE__, __FUNCTION__, __LINE__); DebugStream::debug(__VA_ARGS__); } while(0);
+
+///Debug output (if enabled), same syntax as printf, no heading info
+#define DBGL(...) do{ DebugStream::debug(__VA_ARGS__); } while(0);
 #define DBG_END DebugStream::release
+
+///Break point usin serial debug interface (if debug enbaled)
 #define BREAK() DebugStream::breakPoint(__FILE__, __LINE__)
 #endif
 
--- a/LPC2368/services/http/client/HTTPClient.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/services/http/client/HTTPClient.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,12 +21,16 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP Client header file
+*/
+
 #ifndef HTTP_CLIENT_H
 #define HTTP_CLIENT_H
 
 class HTTPData;
 
-#include "if/net/net.h"
+#include "core/net.h"
 #include "api/TCPSocket.h"
 #include "api/DNSRequest.h"
 #include "HTTPData.h"
@@ -38,33 +42,68 @@
 #include <map>
 using std::map;
 
+///HTTP client results
 enum HTTPResult
 {
-  HTTP_OK,
-  HTTP_PROCESSING,
-  HTTP_PARSE, //URI Parse error
-  HTTP_DNS, //Could not resolve name
-  HTTP_PRTCL, //Protocol error
-  HTTP_NOTFOUND, //404 Error
-  HTTP_REFUSED, //403 Error
-  HTTP_ERROR, //xxx error
-  HTTP_TIMEOUT, //Connection timeout
-  HTTP_CONN //Connection error
+  HTTP_OK, ///<Success
+  HTTP_PROCESSING, ///<Processing
+  HTTP_PARSE, ///<URI Parse error
+  HTTP_DNS, ///<Could not resolve name
+  HTTP_PRTCL, ///<Protocol error
+  HTTP_NOTFOUND, ///<HTTP 404 Error
+  HTTP_REFUSED, ///<HTTP 403 Error
+  HTTP_ERROR, ///<HTTP xxx error
+  HTTP_TIMEOUT, ///<Connection timeout
+  HTTP_CONN ///<Connection error
 };
 
+#include "core/netservice.h"
 
-
+///A simple HTTP Client
+/**
+The HTTPClient is composed of:
+- The actual client (HTTPClient)
+- Classes that act as a data repository, each of which deriving from the HTTPData class (HTTPText for short text content, HTTPFile for file I/O, HTTPMap for key/value pairs, and HTTPStream for streaming purposes)
+*/
 class HTTPClient : protected NetService
 {
 public:
+  ///Instantiates the HTTP client
   HTTPClient();
   virtual ~HTTPClient();
   
+  ///Provides a basic authentification feature (Base64 encoded username and password)
   void basicAuth(const char* user, const char* password); //Basic Authentification
   
   //High Level setup functions
+  ///Executes a GET Request (blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  Blocks until completion
+  */
   HTTPResult get(const char* uri, HTTPData* pDataIn); //Blocking
+  
+  ///Executes a GET Request (non blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pMethod : callback function
+  The function returns immediately and calls the callback on completion or error
+  */
   HTTPResult get(const char* uri, HTTPData* pDataIn, void (*pMethod)(HTTPResult)); //Non blocking
+  
+  ///Executes a GET Request (non blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pItem : instance of class on which to execute the callback method
+  @param pMethod : callback method
+  The function returns immediately and calls the callback on completion or error
+  */
   template<class T> 
   HTTPResult get(const char* uri, HTTPData* pDataIn, T* pItem, void (T::*pMethod)(HTTPResult)) //Non blocking
   {
@@ -73,8 +112,37 @@
     return HTTP_PROCESSING;
   }
   
+  ///Executes a POST Request (blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  Blocks until completion
+  */
   HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn); //Blocking
+  
+  ///Executes a POST Request (non blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pMethod : callback function
+  The function returns immediately and calls the callback on completion or error
+  */
   HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn, void (*pMethod)(HTTPResult)); //Non blocking
+  
+  ///Executes a POST Request (non blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pItem : instance of class on which to execute the callback method
+  @param pMethod : callback method
+  The function returns immediately and calls the callback on completion or error
+  */
   template<class T> 
   HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn, T* pItem, void (T::*pMethod)(HTTPResult)) //Non blocking  
   {
@@ -82,28 +150,68 @@
     doPost(uri, dataOut, pDataIn);
     return HTTP_PROCESSING;
   }
+
+  ///Executes a GET Request (non blocking)
+  /**
+  Executes a GET request on the URI uri
+  @param uri : URI on which to execute the request
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  The function returns immediately and calls the previously set callback on completion or error
+  */  
+  void doGet(const char* uri, HTTPData* pDataIn);  
   
-  void doGet(const char* uri, HTTPData* pDataIn);  
+  ///Executes a POST Request (non blocking)
+  /**
+  Executes a POST request on the URI uri
+  @param uri : URI on which to execute the request
+  @param dataOut : a HTTPData instance that contains the data that will be posted
+  @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL
+  @param pMethod : callback function
+  The function returns immediately and calls the previously set callback on completion or error
+  */
   void doPost(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn); 
   
+  ///Setups the result callback
+  /**
+  @param pMethod : callback function
+  */
   void setOnResult( void (*pMethod)(HTTPResult) );
+  
+  ///Setups the result callback
+  /**
+  @param pItem : instance of class on which to execute the callback method
+  @param pMethod : callback method
+  */
   class CDummy;
   template<class T> 
-  //Linker bug : Must be defined here :(
   void setOnResult( T* pItem, void (T::*pMethod)(HTTPResult) )
   {
     m_pCb = NULL;
     m_pCbItem = (CDummy*) pItem;
     m_pCbMeth = (void (CDummy::*)(HTTPResult)) pMethod;
   }
-  
+
+  ///Setups timeout
+  /**
+  @param ms : time of connection inactivity in ms after which the request should timeout
+  */
   void setTimeout(int ms);
   
   virtual void poll(); //Called by NetServices
   
+  ///Gets last request's HTTP response code
+  /**
+  @return The HTTP response code of the last request
+  */
   int getHTTPResponseCode();
+  
+  ///Sets a specific request header
   void setRequestHeader(const string& header, const string& value);
+  
+  ///Gets a response header
   string& getResponseHeader(const string& header);
+  
+  ///Clears request headers
   void resetRequestHeaders();
   
 protected:
--- a/LPC2368/services/http/client/HTTPData.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/services/http/client/HTTPData.h	Thu Aug 05 15:09:46 2010 +0000
@@ -24,7 +24,7 @@
 #ifndef HTTP_DATA_H
 #define HTTP_DATA_H
 
-#include "if/net/net.h"
+#include "core/net.h"
 
 #include <string>
 using std::string;
--- a/LPC2368/services/http/client/data/HTTPFile.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/services/http/client/data/HTTPFile.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,18 +21,38 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP File data source/sink header file
+*/
+
 #ifndef HTTP_FILE_H
 #define HTTP_FILE_H
 
 #include "../HTTPData.h"
 #include "mbed.h"
 
+///HTTP Client data container for files
+/**
+This class provides file access/storage for HTTP requests and responses' data payloads.
+
+
+*/
 class HTTPFile : public HTTPData //Read or Write data from a file
 {
 public:
+  ///Instantiates data source/sink with file in param.
+  /**
+  Uses file at path @a path.
+  It will be opened when some data has to be read/written from/to it and closed when this operation is complete or on destruction of the instance.
+  Note that the file will be opened with mode "w" for writing and mode "r" for reading, so the file will be cleared between each request if you are using it for writing.
+  
+  @note
+  Note that to use this you must instantiate a proper file system (such as the LocalFileSystem or the SDFileSystem).
+  */
   HTTPFile(const char* path);
   virtual ~HTTPFile();
   
+  ///Forces file closure
   virtual void clear();
 
 protected:
--- a/LPC2368/services/http/client/data/HTTPMap.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/services/http/client/data/HTTPMap.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,6 +21,10 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP Map data source/sink header file
+*/
+
 #ifndef HTTP_MAP_H
 #define HTTP_MAP_H
 
@@ -32,15 +36,29 @@
 
 typedef map<string, string> Dictionary;
 
+///HTTP Client data container for key/value pairs
+/**
+This class simplifies the use of key/value pairs requests and responses used widely among web APIs.
+Note that HTTPMap inherits from std::map<std::string,std::string>.
+You can therefore use any public method of that class, including the square brackets operator ( [ ] ) to access a value.
+
+The data is encoded or decoded to/from a key/value pairs-formatted string, after url-encoding/decoding.
+*/
 class HTTPMap : public HTTPData, public Dictionary //Key/Value pairs
 {
 public:
+  ///Instantiates map
+  /**
+  @param keyValueSep Key/Value separator (defaults to "=")
+  @param pairSep Pairs separator (defaults to "&")
+  */
   HTTPMap(const string& keyValueSep = "=", const string& pairSep = "&");
   virtual ~HTTPMap();
   
  /* string& operator[](const string& key);
   int count();*/
 
+  ///Clears the content
   virtual void clear();  
   
 protected:
--- a/LPC2368/services/http/client/data/HTTPStream.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/services/http/client/data/HTTPStream.h	Thu Aug 05 15:09:46 2010 +0000
@@ -27,18 +27,36 @@
 #include "../HTTPData.h"
 #include "mbed.h"
 
+/** \file
+HTTP Stream data source/sink header file
+*/
+
 typedef uint8_t byte;
 
+///HTTP Client Streaming tool
+/**
+This class allows you to stream data from the web using a persisting HTTP connection.
+To use it properly you must use a non-blocking HTTPClient method.
+*/
 class HTTPStream : public HTTPData //Streaming buf
 {
 public:
+  ///Instantiates the object
   HTTPStream();
   virtual ~HTTPStream();
   
+  ///Starts to read into buffer
+  /**
+  Passes a buffer of address @a buf and size @a size to the instance.
+  When it receives data it will be stored in this buffer.
+  When the buffer is full it throttles the client until this function is called again.
+  */
   void readNext(byte* buf, int size);
   
+  ///Returns whether there is data available to read
   bool readable();
   
+  ///Returns the actual length of the payload written in the buffer
   int readLen();
   
   virtual void clear();
--- a/LPC2368/services/http/client/data/HTTPText.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/services/http/client/data/HTTPText.h	Thu Aug 05 15:09:46 2010 +0000
@@ -21,6 +21,10 @@
 THE SOFTWARE.
 */
 
+/** \file
+HTTP Text data source/sink header file
+*/
+
 #ifndef HTTP_TEXT_H
 #define HTTP_TEXT_H
 
@@ -29,18 +33,50 @@
 
 #define DEFAULT_MAX_MEM_ALLOC 512 //Avoid out-of-memory problems
 
+///HTTP Client data container for text
+/**
+This is a simple "Text" data repository for HTTP requests.
+*/
 class HTTPText : public HTTPData //Simple Text I/O
 {
 public:
+  ///Instantiates the object.
+  /**
+  @param encoding encoding of the data, it defaults to text/html.
+  @param maxSize defines the maximum memory size that can be allocated by the object. It defaults to 512 bytes.
+  */
   HTTPText(const string& encoding = "text/html", int maxSize = DEFAULT_MAX_MEM_ALLOC);
   virtual ~HTTPText();
   
+  ///Gets text
+  /**
+  Returns the text in the container as a zero-terminated char*.
+  The array returned points to the internal buffer of the object and remains owned by the object.
+  */
   const char* gets() const;
+  
+  //Puts text
+  /**
+  Sets the text in the container using a zero-terminated char*.
+  */
   void puts(const char* str);
   
+  ///Gets text
+  /**
+  Returns the text in the container as string.
+  */
   string& get();
+  
+  ///Puts text
+  /**
+  Sets the text in the container as string.
+  */
   void set(const string& str);
   
+  ///Clears the content.
+  /**
+  If this container is used as a data sink, it is cleared by the HTTP Client at the beginning of the request.
+  */
   virtual void clear();
   
 protected:
--- a/LPC2368/services/http/util/url.h	Fri Jul 09 14:35:21 2010 +0000
+++ b/LPC2368/services/http/util/url.h	Thu Aug 05 15:09:46 2010 +0000
@@ -24,7 +24,7 @@
 #ifndef URL_H
 #define URL_H
 
-#include "if/net/ipaddr.h"
+#include "core/ipaddr.h"
 
 #include <string>
 using std::string;