Add set_proxy().
This commit is contained in:
parent
921e4e271e
commit
194e729b29
|
@ -83,6 +83,12 @@ void CURLWrapper::set_useragent(string_view useragent)
|
|||
check(curl_easy_setopt(_connection, CURLOPT_USERAGENT, useragent.data()));
|
||||
}
|
||||
|
||||
void CURLWrapper::set_proxy(const string_view proxy)
|
||||
{
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
|
||||
check(curl_easy_setopt(_connection, CURLOPT_PROXY, proxy.data()));
|
||||
}
|
||||
|
||||
answer CURLWrapper::make_http_request(http_method method, string_view uri)
|
||||
{
|
||||
_buffer_headers.clear();
|
||||
|
|
|
@ -154,6 +154,18 @@ public:
|
|||
*/
|
||||
void set_useragent(string_view useragent);
|
||||
|
||||
/*!
|
||||
* @brief Set a proxy.
|
||||
*
|
||||
* For more information consult [CURLOPT_PROXY(3)]
|
||||
* (https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html).
|
||||
*
|
||||
* May throw CURLException.
|
||||
*
|
||||
* @since 0.1.1
|
||||
*/
|
||||
inline void set_proxy(string_view proxy);
|
||||
|
||||
/*!
|
||||
* @brief Make a HTTP request.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user