5#ifndef MOLYBDEN_URL_REQUEST_JOB_HPP
6#define MOLYBDEN_URL_REQUEST_JOB_HPP
12#include "molybden/network/http_header.hpp"
13#include "molybden/network/http_status_code.hpp"
28 virtual std::string
id() = 0;
39 virtual void write(
const std::vector<uint8_t>& bytes) = 0;
51 virtual void write(
char* bytes, uint32_t size) = 0;
81 HttpStatusCode status,
82 const std::vector<HttpHeader>& headers) = 0;
A factory that allows you to create UrlRequestJob instances.
Definition url_request_job.hpp:69
virtual std::shared_ptr< UrlRequestJob > createJob(HttpStatusCode status, const std::vector< HttpHeader > &headers)=0
Creates and returns a new UrlRequestJob instance.
A URL request job is a mechanism to provide the response data for an intercepted URL request.
Definition url_request_job.hpp:21
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 fail()=0
Notifies the engine that an error occurred during writing the response data and the request should be...
virtual void complete()=0
Notifies the engine that all the response data chunks are written and the request should be completed...
virtual std::string id()=0
Returns the identifier of this URL request job.