Webserv
Loading...
Searching...
No Matches
http Namespace Reference

Namespaces

namespace  details
namespace  error_pages

Classes

class  CGIHandler
 Handles the execution of CGI scripts. More...
class  DefaultErrorHandler
 Handles the execution of CGI scripts. More...
class  HttpRequest
 A data container for a parsed HTTP request. More...
class  HttpResponse
 A data container for an HTTP response. More...
class  IHandler
 Abstract interface for all request handlers (Strategy Pattern). More...
class  MimeTypes
class  NotFoundHandler
 Handles the generation of not found(404). More...
class  Router
 The central request dispatcher. More...
struct  RouterResult
 A data container for the result of a routing decision. More...
class  StaticFileHandler
 Handles serving static files from the filesystem. More...

Typedefs

typedef std::map< std::string, std::string > HeaderMap

Enumerations

enum  BodySourceType { BODY_NONE , BODY_IN_MEMORY , BODY_FROM_FILE , BODY_FROM_CGI }
 Defines the source of the data for an HTTP response body. More...
enum  Status {
  OK = 200 , CREATED = 201 , ACCEPTED = 202 , NO_CONTENT = 204 ,
  BAD_REQUEST = 400 , UNAUTHORIZED = 401 , FORBIDDEN = 403 , NOT_FOUND = 404 ,
  METHOD_NOT_ALLOWED = 405 , INTERNAL_SERVER_ERROR = 500
}
 Enumeration of common HTTP status codes. More...

Functions

std::ostream & operator<< (std::ostream &o, HttpRequest const &r)
std::ostream & operator<< (std::ostream &o, HttpRequest::HeaderMap const &r)
std::ostream & operator<< (std::ostream &o, HttpResponse const &r)
ostream & operator<< (ostream &o, HttpRequest::HeaderMap const &r)

Typedef Documentation

◆ HeaderMap

typedef std::map<std::string, std::string> http::HeaderMap

Enumeration Type Documentation

◆ BodySourceType

Defines the source of the data for an HTTP response body.

This allows the server's Reactor to determine how to handle the sending of the response body, whether it's from memory, a file, or another process.

Enumerator
BODY_NONE 

No body will be sent (e.g., for HEAD requests or 204 No Content).

BODY_IN_MEMORY 

The body is fully generated and stored in a memory buffer.

BODY_FROM_FILE 

The body should be streamed directly from a file descriptor.

BODY_FROM_CGI 

The body should be streamed from a CGI script's output pipe.

◆ Status

Enumeration of common HTTP status codes.

Enumerator
OK 
CREATED 

200 OK — request succeeded.

ACCEPTED 

201 Created — resource created.

NO_CONTENT 

202 Accepted — processing pending.

BAD_REQUEST 

204 No Content — successful, no body.

UNAUTHORIZED 

400 Bad Request — malformed syntax.

FORBIDDEN 

401 Unauthorized — authentication required/failed.

NOT_FOUND 

403 Forbidden — not allowed despite authentication.

METHOD_NOT_ALLOWED 

404 Not Found — resource not found.

INTERNAL_SERVER_ERROR 

405 Method Not Allowed — method not permitted.

Function Documentation

◆ operator<<() [1/4]

ostream & http::operator<< ( ostream & o,
HttpRequest::HeaderMap const & r )

◆ operator<<() [2/4]

std::ostream & http::operator<< ( std::ostream & o,
HttpRequest const & r )

◆ operator<<() [3/4]

std::ostream & http::operator<< ( std::ostream & o,
HttpRequest::HeaderMap const & r )

◆ operator<<() [4/4]

std::ostream & http::operator<< ( std::ostream & o,
HttpResponse const & r )