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:
@@ -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
|
||||
Reference in New Issue
Block a user