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

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

#include <HTTPLoader.hpp>

Collaboration diagram for samchon::library::HTTPLoader:

Public Member Functions

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

Private Attributes

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

Static Private Attributes

static HashMap< std::string, std::string > cookieMap
 Cookies got from remote web server. More...
 

Detailed Description

A http, web-page loader.

library_http.png
Note
Depreciated
See also
samchon::library
Author
Jeongho Nam http://samchon.org

Definition at line 23 of file HTTPLoader.hpp.

Constructor & Destructor Documentation

HTTPLoader::HTTPLoader ( int  method = POST)

Construct from request method.

Parameters
methodGet or Post.

Definition at line 26 of file HTTPLoader.cpp.

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

Construct from request url and method.

Parameters
urlTarget url of remote web server.
methodGet or Post

Member Function Documentation

void HTTPLoader::setURL ( const std::string &  )

Set url.

Definition at line 39 of file HTTPLoader.cpp.

void HTTPLoader::setMethod ( int  method)

Set method.

Definition at line 43 of file HTTPLoader.cpp.

auto HTTPLoader::getURL ( ) const -> std::string

Get url.

Definition at line 48 of file HTTPLoader.cpp.

auto HTTPLoader::getMethod ( ) const -> int

Get method.

Definition at line 52 of file HTTPLoader.cpp.

auto HTTPLoader::getCookie ( const std::string &  ) const -> std::string

Get cookie.

Definition at line 57 of file HTTPLoader.cpp.

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

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 100 of file HTTPLoader.cpp.

References samchon::WeakString::between(), samchon::WeakString::find(), samchon::HashMap< Key, T, Hash, Pred, Alloc >::get(), samchon::HashMap< Key, T, Hash, Pred, Alloc >::has(), samchon::HashMap< Key, T, Hash, Pred, Alloc >::set(), samchon::WeakString::split(), samchon::WeakString::str(), 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 31 of file HTTPLoader.hpp.

HashMap< string, string > HTTPLoader::cookieMap
staticprivate

Cookies got from remote web server.

Definition at line 36 of file HTTPLoader.hpp.


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