[HTTP] Added Doxygen comments

pull/13/head
jgromes 2019-05-24 18:49:15 +02:00
rodzic 11004fa685
commit d65033666f
1 zmienionych plików z 49 dodań i 5 usunięć

Wyświetl plik

@ -4,19 +4,63 @@
#include "TypeDef.h"
#include "TransportLayer.h"
/*!
\class HTTPClient
\brief Client for simple HTTP communication.
*/
class HTTPClient {
public:
// constructor
/*!
\brief Default constructor.
\param tl Pointer to the wireless module providing TransportLayer communication.
\param port Port to be used for HTTP. Defaults to 80.
*/
HTTPClient(TransportLayer* tl, uint16_t port = 80);
// basic methods
/*!
\brief Sends HTTP GET request.
\param url URL to send the request to.
\param response Arduino String object that will save the response.
\returns \ref status_codes
*/
int16_t get(String& url, String& response);
/*!
\brief Sends HTTP GET request.
\param url URL to send the request to.
\param response Arduino String object that will save the response.
\returns \ref status_codes
*/
int16_t get(const char* url, String& response);
/*!
\brief Sends HTTP POST request.
\param url URL to send the request to.
\param content Request content.
\param response Arduino String object that will save the response.
\param contentType MIME type of request content. Defaults to "text/plain".
\returns \ref status_codes
*/
int16_t post(const char* url, const char* content, String& response, const char* contentType = "text/plain");
private:
TransportLayer* _tl;
uint16_t _port;
};