Added support for sending and receiving HTTP requests.

Added 'HttpSocket', which inherits TcpSocket and adds a receive and send functions for WebRequest objects.

WebRequest objects can be used to parse, construct and extract HTTP requests. They can be sent through HttpSocket's.
This commit is contained in:
Fred Nicolson
2016-12-10 15:11:01 +00:00
parent a3eb2ccd0a
commit 7aced77a00
7 changed files with 453 additions and 16 deletions
+35
View File
@@ -0,0 +1,35 @@
//
// Created by fred on 10/12/16.
//
#ifndef FRNETLIB_HTTPSOCKET_H
#define FRNETLIB_HTTPSOCKET_H
#include "TcpSocket.h"
#include "HttpRequest.h"
namespace fr
{
class HttpSocket : public TcpSocket
{
public:
/*!
* Sends a HTTP request to the connected socket.
*
* @param request The request to send
* @return The status of the operation.
*/
Socket::Status receive(HttpRequest &request);
/*!
* Sends a HTTP request to the connected socket.
*
* @param request Where to store the received request.
* @return The status of the operation.
*/
Socket::Status send(const HttpRequest &request);
};
}
#endif //FRNETLIB_HTTPSOCKET_H