struct
#include <include/coeurl/request.hpp>
Request A HTTP request.
Can be sent using a Client You can listen to various events here and access the response, after it finished.
Public types
Constructors, destructors, conversion operators
Public functions
- void operator=(Request const&) deleted
- Uncopyable.
- void operator=(Request&&) deleted
- Unmoveable.
- auto max_redirects(long amount) -> Request&
- The maximum number of redirects. Defaults to 0.
- auto verify_peer(bool verify) -> Request&
- Whether to verify the certificate of the peer. Defaults to whatever is set on the client (usually true).
- auto request(std::string r, std::string contenttype = "application/octet-stream") -> Request&
- The actual request body. contenttype defaults to "application/octet-stream".
- auto request_headers(const Headers& h) -> Request&
- Headers for this request.
- auto connection_timeout(long t) -> Request&
- Timeout connection after the specified amount of seconds, if the server stops sending acks.
- auto on_complete(const std::function<void(const Request&)> handler) -> Request&
- Optional completion handler.
- auto on_upload_progress(std::function<void(size_t progress, size_t total)> handler) -> Request&
- Optional upload progress handler.
- auto on_download_progess(std::function<void(size_t progress, size_t total)> handler) -> Request&
- Optional download progress handler.
- auto url() const -> std::string_view
- The url for this request.
- auto response() const -> std::string_view
- The response in this request.
- auto response_code() const -> int
- The HTTP response code. 200 for success.
- auto error_code() const -> CURLcode
- The curl error code. CURLE_OK (0) on success.
- auto response_headers() const -> Headers
- Headers for the response.
Enum documentation
Function documentation
Request& coeurl:: Request:: request_headers(const Headers& h)
Headers for this request.
Headers coeurl:: Request:: response_headers() const
Headers for the response.