Molybden API
Loading...
Searching...
No Matches
molybden::UrlRequestJob Class Referenceabstract

A URL request job is a mechanism to provide the response data for an intercepted URL request. More...

#include <url_request_job.hpp>

Public Member Functions

virtual std::string id ()=0
 Returns the identifier of this URL request job.
 
virtual void write (const std::vector< uint8_t > &bytes)=0
 Appends a chunk of the response data to the URL request.
 
virtual void write (char *bytes, uint32_t size)=0
 Appends a chunk of the response data to the URL request.
 
virtual void complete ()=0
 Notifies the engine that all the response data chunks are written and the request should be completed.
 
virtual void fail ()=0
 Notifies the engine that an error occurred during writing the response data and the request should be failed.
 

Detailed Description

A URL request job is a mechanism to provide the response data for an intercepted URL request.

Member Function Documentation

◆ write() [1/2]

virtual void molybden::UrlRequestJob::write ( char *  bytes,
uint32_t  size 
)
pure virtual

Appends a chunk of the response data to the URL request.

This method may be called multiple times to append several chunks. When all the chunks are written either the Complete() or Fail() method must be called to indicate that the request is completed or failed.

Parameters
datathe response data bytes.
sizethe response data bytes size.

◆ write() [2/2]

virtual void molybden::UrlRequestJob::write ( const std::vector< uint8_t > &  bytes)
pure virtual

Appends a chunk of the response data to the URL request.

This method may be called multiple times to append several chunks. When all the chunks are written either the Complete() or Fail() method must be called to indicate that the request is completed or failed.

Parameters
datathe response data bytes.

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