Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::HttpResponse Struct Reference

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

#include <HttpServer.h>

Public Member Functions

Result startResponse (int httpCode)
 Starts the response with a http standard code (200 OK, 404 NOT FOUND etc.)
 
Result addHeader (StringSpan headerName, StringSpan headerValue)
 Writes an http header to this response.
 
Result sendHeaders ()
 Start sending response headers, before sending any data.
 
void reset ()
 Resets this object for it to be re-usable.
 
Result end ()
 Finalizes the writable stream after sending all in progress writes.
 
AsyncWritableStreamgetWritableStream ()
 Obtain writable stream to write content.
 

Friends

struct HttpServer
 
struct HttpAsyncServer
 

Detailed Description

Http response that will be sent to a client.

Member Function Documentation

◆ addHeader()

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

Writes an http header to this response.

◆ end()

Result SC::HttpResponse::end ( )

Finalizes the writable stream after sending all in progress writes.

◆ getWritableStream()

AsyncWritableStream & SC::HttpResponse::getWritableStream ( )
inline

Obtain writable stream to write content.

◆ reset()

void SC::HttpResponse::reset ( )

Resets this object for it to be re-usable.

◆ sendHeaders()

Result SC::HttpResponse::sendHeaders ( )

Start sending response headers, before sending any data.

◆ startResponse()

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

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


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