15 #ifndef SHAKA_EMBEDDED_JS_XML_HTTP_REQUEST_H_ 16 #define SHAKA_EMBEDDED_JS_XML_HTTP_REQUEST_H_ 18 #include <curl/curl.h> 86 const std::string& value);
103 size_t OnUpload(uint8_t* buffer,
size_t length);
126 void RaiseProgressEvents();
129 void OnRequestComplete(CURLcode code);
133 mutable Mutex mutex_;
134 std::map<std::string, std::string> response_headers_;
139 curl_slist* request_headers_;
141 uint64_t last_progress_time_;
142 double estimated_size_;
143 bool parsing_headers_;
144 bool with_credentials_;
145 std::atomic<bool> abort_pending_;
159 #endif // SHAKA_EMBEDDED_JS_XML_HTTP_REQUEST_H_
std::string GetAllResponseHeaders() const
static XMLHttpRequest * Create()
bool WithCredentials() const
Listener on_ready_state_change
void Trace(memory::HeapTracer *tracer) const override
std::string response_text
optional< std::string > GetResponseHeader(const std::string &name) const
CONVERT_ENUM_AS_NUMBER(shaka::js, XMLHttpRequest::ReadyState)
void OnHeaderReceived(const uint8_t *buffer, size_t length)
ExceptionOr< void > Open(const std::string &method, const std::string &url, optional< bool > async, optional< std::string > user, optional< std::string > password)
bool IsShortLived() const override
ExceptionOr< void > SetWithCredentials(bool with_credentials)
std::string response_type
ExceptionOr< void > Send(optional< variant< ByteBuffer, ByteString >> maybe_data)
void OnDataReceived(uint8_t *buffer, size_t length)
size_t OnUpload(uint8_t *buffer, size_t length)
ExceptionOr< void > SetRequestHeader(const std::string &key, const std::string &value)