Samchon Framework for CPP  1.0.0
samchon::library::HTTPLoader Class Reference

A http, web-page loader. More...

#include <HTTPLoader.hpp>

Public Member Functions

 HTTPLoader (const std::string &url, int method=POST)
 Construct from request url and method. More...
 
void setURL (const std::string &val)
 Set url. More...
 
void setMethod (int val)
 Set method. More...
 
auto getURL () const -> std::string
 Get url. More...
 
auto getMethod () const -> int
 Get method. More...
 
auto getCookie (const std::string &key) const -> std::string
 Get cookie. More...
 
auto load (const URLVariables &parameters={}) const -> ByteArray
 Load data from target url. More...
 

Static Private Member Functions

static HashMap< std::string, std::string > & cookie_map ()
 Cookies got from remote web server. More...
 

Private Attributes

int method
 Method, Get or Post. More...
 

Detailed Description

A http, web-page loader.

Class Diagram
Author
Jeongho Nam http://samchon.org

Definition at line 26 of file HTTPLoader.hpp.

Constructor & Destructor Documentation

samchon::library::HTTPLoader::HTTPLoader ( const std::string &  url,
int  method = POST 
)
inline

Construct from request url and method.

Parameters
urlTarget url of remote web server.
methodGet or Post

Definition at line 62 of file HTTPLoader.hpp.

References method.

Member Function Documentation

static HashMap<std::string, std::string>& samchon::library::HTTPLoader::cookie_map ( )
inlinestaticprivate

Cookies got from remote web server.

Definition at line 39 of file HTTPLoader.hpp.

Referenced by getCookie(), and load().

Here is the caller graph for this function:

void samchon::library::HTTPLoader::setURL ( const std::string &  val)
inline

Set url.

Definition at line 75 of file HTTPLoader.hpp.

void samchon::library::HTTPLoader::setMethod ( int  val)
inline

Set method.

Definition at line 83 of file HTTPLoader.hpp.

References method.

auto samchon::library::HTTPLoader::getURL ( ) const -> std::string
inline

Get url.

Definition at line 91 of file HTTPLoader.hpp.

auto samchon::library::HTTPLoader::getMethod ( ) const -> int
inline

Get method.

Definition at line 99 of file HTTPLoader.hpp.

References method.

auto samchon::library::HTTPLoader::getCookie ( const std::string &  key) const -> std::string
inline

Get cookie.

Definition at line 107 of file HTTPLoader.hpp.

References cookie_map().

Referenced by load().

Here is the call graph for this function:

Here is the caller graph for this function:

auto samchon::library::HTTPLoader::load ( const URLVariables parameters = {}) const -> ByteArray
inline

Load data from target url.

Loads binary data from target web server and address.

Parameters
dataURLVariables containing parameters to request.
Returns
Binary data fetched from remote web server.

Definition at line 128 of file HTTPLoader.hpp.

References samchon::WeakString::between(), cookie_map(), samchon::library::URLVariables::encode(), samchon::WeakString::find(), samchon::HashMap< Key, T, Hash, Pred, Alloc >::get(), getCookie(), samchon::HashMap< Key, T, Hash, Pred, Alloc >::has(), samchon::HashMap< Key, T, Hash, Pred, Alloc >::set(), samchon::WeakString::split(), samchon::WeakString::str(), samchon::library::StringUtil::substitute(), and samchon::WeakString::substr().

Here is the call graph for this function:

Member Data Documentation

int samchon::library::HTTPLoader::method
private

Method, Get or Post.

Definition at line 34 of file HTTPLoader.hpp.

Referenced by getMethod(), HTTPLoader(), and setMethod().


The documentation for this class was generated from the following file: