Kurlyk
Loading...
Searching...
No Matches
http_client_proxy_example.cpp File Reference
#include <iostream>
#include <fstream>
#include <sstream>
#include <unordered_map>
#include <kurlyk.hpp>

Go to the source code of this file.

Functions

std::unordered_map< std::string, std::string > read_proxy_config (const std::string &filename)
 Reads proxy configuration from a text file.
 
void print_response (const kurlyk::HttpResponsePtr &response)
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 45 of file http_client_proxy_example.cpp.

◆ print_response()

void print_response ( const kurlyk::HttpResponsePtr & response)

Definition at line 35 of file http_client_proxy_example.cpp.

◆ read_proxy_config()

std::unordered_map< std::string, std::string > read_proxy_config ( const std::string & filename)

Reads proxy configuration from a text file.

Parameters
filenamePath to the configuration file.
Returns
A map containing proxy configuration values.

The configuration file format (proxy_config.txt) should be as follows:

proxy_ip=127.0.0.1
proxy_port=8080
proxy_username=username
proxy_password=password

Only proxy_ip and proxy_port are required. proxy_username and proxy_password are optional and will only be used if present in the file.

Definition at line 20 of file http_client_proxy_example.cpp.