This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofURLFileLoader.h
Go to the documentation of this file.
47 ofHttpResponse(const ofHttpRequest& request, const ofBuffer& data, int status, const std::string& error);
virtual ofHttpResponse handleRequest(const ofHttpRequest &request)=0
low level HTTP request implementation blocks until a response is returned or the request times out
virtual ofHttpResponse saveTo(const std::string &url, const of::filesystem::path &path)=0
make an HTTP request and save the response data to a file blocks until a response is returned or the ...
virtual ofHttpResponse get(const std::string &url)=0
make an HTTP request blocks until a response is returned or the request times out
virtual int saveAsync(const std::string &url, const of::filesystem::path &path)=0
make an asynchronous HTTP request and save the response data to a file will not block,...
virtual int handleRequestAsync(const ofHttpRequest &request)=0
virtual int getAsync(const std::string &url, const std::string &name="")=0
make an asynchronous HTTP request will not block, placed in a queue and run using a background thread
virtual void remove(int id)=0
remove an active HTTP request from the queue
virtual ~ofBaseURLFileLoader()
Definition ofURLFileLoader.h:176
Definition ofFileUtils.h:15
Definition ofEvent.h:444
enum ofHttpRequest::Method method
std::string contentType
POST data mime type.
Definition ofURLFileLoader.h:23
OF_DEPRECATED_MSG("Use getId().", int getID())
ofHttpRequest(const std::string &url, const std::string &name, bool saveTo=false)
bool saveTo
save to a file once the request is finised?
Definition ofURLFileLoader.h:20
@ GET
request data from a specified resource (via url)
Definition ofURLFileLoader.h:33
@ POST
submit data to be processed to a specified resource (via url)
Definition ofURLFileLoader.h:34
std::map< std::string, std::string > headers
HTTP header keys & values.
Definition ofURLFileLoader.h:21
std::string error
HTTP error string, if any (OK, Not Found, etc)
Definition ofURLFileLoader.h:55
ofHttpResponse(const ofHttpRequest &request, const ofBuffer &data, int status, const std::string &error)
int status
HTTP response status (200: OK, 404: Not Found, etc)
Definition ofURLFileLoader.h:54
ofHttpRequest request
matching HTTP request for this response
Definition ofURLFileLoader.h:52
ofHttpResponse(const ofHttpRequest &request, int status, const std::string &error)
int handleRequestAsync(const ofHttpRequest &request)
Definition ofURLFileLoader.cpp:320
ofHttpResponse handleRequest(const ofHttpRequest &request)
Definition ofURLFileLoader.cpp:316
void clear()
clear all active HTTP requests from the queue
Definition ofURLFileLoader.cpp:308
void stop()
stop & remove all active and waiting HTTP requests
Definition ofURLFileLoader.cpp:312
int saveAsync(const std::string &url, const of::filesystem::path &path)
make an asynchronous HTTP request and save the response data to a file will not block,...
Definition ofURLFileLoader.cpp:300
ofHttpResponse saveTo(const std::string &url, const of::filesystem::path &path)
make an HTTP request and save the response data to a file blocks until a response is returned or the ...
Definition ofURLFileLoader.cpp:296
int getAsync(const std::string &url, const std::string &name="")
make an asynchronous HTTP request will not block, placed in a queue and run using a background thread
Definition ofURLFileLoader.cpp:292
ofHttpResponse get(const std::string &url)
make an HTTP request blocks until a response is returned or the request times out
Definition ofURLFileLoader.cpp:288
void remove(int id)
remove an active HTTP request from the queue
Definition ofURLFileLoader.cpp:304
void ofRemoveListener(EventType &event, ListenerClass *listener, void(ListenerClass::*listenerMethod)(const void *, ArgumentsType &), int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofEventUtils.h:120
void ofAddListener(EventType &event, ListenerClass *listener, void(ListenerClass::*listenerMethod)(const void *, ArgumentsType &), int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofEventUtils.h:19
ofHttpResponse ofSaveURLTo(const std::string &url, const of::filesystem::path &path)
make an HTTP GET request and save the response data to a file blocks until a response is returned or ...
int ofSaveURLAsync(const std::string &url, const of::filesystem::path &path)
make an asynchronous HTTP request and save the response data to a file will not block,...
ofHttpResponse ofLoadURL(const std::string &url)
make an HTTP GET request blocks until a response is returned or the request times out
void ofRemoveURLRequest(int id)
remove an active HTTP request from the queue
Definition ofURLFileLoader.cpp:399
int ofLoadURLAsync(const std::string &url, const std::string &name="")
make an asynchronous HTTP GET request will not block, placed in a queue and run using a background th...
void ofStopURLLoader()
stop & remove all active and waiting HTTP requests
Definition ofURLFileLoader.cpp:407
void ofRemoveAllURLRequests()
remove all active HTTP requests from the queue
Definition ofURLFileLoader.cpp:403