cpp Rest API master
C++ library for REST API access with Qt, Curl and cpp-httplib backends
 
Loading...
Searching...
No Matches
cpp_restapi::SseParser Class Reference

Incremental parser for Server-Sent Events stream. More...

#include <sse_parser.hpp>

Public Member Functions

std::vector< SseEventfeed (const std::string &chunk)
 Feed raw data from the SSE stream.
 

Detailed Description

Incremental parser for Server-Sent Events stream.

Accumulates raw data from an SSE stream and extracts complete events as they become available. Implements parsing rules from the SSE specification: https://html.spec.whatwg.org/multipage/server-sent-events.html

Member Function Documentation

◆ feed()

std::vector< SseEvent > cpp_restapi::SseParser::feed ( const std::string & chunk)

Feed raw data from the SSE stream.

Parameters
chunkraw bytes received from the HTTP response
Returns
vector of complete events parsed from the accumulated data

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