Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::HttpResponse Struct Reference

Http response that will be sent to a client. More...

#include <HttpServer.h>

Public Member Functions

ArenaMapKey< HttpServerClient > getClientKey () const
 
Result startResponse (int httpCode)
 Starts the response with a http standard code (200 OK, 404 NOT FOUND etc.) More...
 
Result addHeader (StringView headerName, StringView headerValue)
 Writes an http header to this response. More...
 
Result write (Span< const char > data)
 Appends some data to the response. More...
 
Result end (Span< const char > data)
 Finalizes response appending some data. More...
 
HttpServergetServer ()
 

Friends

struct HttpServer
 

Detailed Description

Http response that will be sent to a client.

Member Function Documentation

◆ addHeader()

Result SC::HttpResponse::addHeader ( StringView  headerName,
StringView  headerValue 
)

Writes an http header to this response.

◆ end()

Result SC::HttpResponse::end ( Span< const char >  data)

Finalizes response appending some data.

Warning
The SC::HttpResponse / SC::HttpRequest pair will be invalidated on next SC::AsyncEventLoop run

◆ startResponse()

Result SC::HttpResponse::startResponse ( int  httpCode)

Starts the response with a http standard code (200 OK, 404 NOT FOUND etc.)

◆ write()

Result SC::HttpResponse::write ( Span< const char >  data)

Appends some data to the response.


The documentation for this struct was generated from the following file: