A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__HTTPClient.html below:

NCBI C++ ToolKit: HTTPClient

  CHttpCookie::CHttpCookie (void)   Create an empty cookie. More...
    CHttpCookie::CHttpCookie (const CTempString &name, const CTempString &value, const CTempString &domain=kEmptyStr, const CTempString &path=kEmptyStr)   Create a cookie with the given attributes. More...
  const stringCHttpCookie::GetName (void) const   Get cookie's name. No encoding/decoding is performed. More...
  const stringCHttpCookie::GetValue (void) const   Get cookie's value. No encoding/decoding is performed. More...
  const stringCHttpCookie::GetDomain (void) const   Get domain. More...
  bool  CHttpCookie::GetHostOnly (void) const   Get host-only flag. More...
  const stringCHttpCookie::GetPath (void) const   Get path. More...
  string  CHttpCookie::GetExpirationStr (void) const   Get string representaion of expiration time (dd-Mon-yyyy hh:mm:ss GMT) or empty string if expiration is not set. More...
  const CTimeCHttpCookie::GetExpirationTime (void) const   The returned CTime may be empty if expiration date is not set. More...
  bool  CHttpCookie::GetSecure (void) const   Get secure flag. More...
  bool  CHttpCookie::GetHttpOnly (void) const   Get HTTP-only flag. More...
  const stringCHttpCookie::GetExtension (void) const   Get any unparsed attributes merged into a single line using semicolon separators. More...
  void  CHttpCookie::SetName (const CTempString &name)   Set cookie's name. More...
  void  CHttpCookie::SetValue (const CTempString &value)   Set cookie's value. More...
  void  CHttpCookie::SetDomain (const CTempString &domain)   Set cookie's domain. More...
  void  CHttpCookie::SetHostOnly (bool host_only)   Set host-only flag. More...
  void  CHttpCookie::SetPath (const CTempString &path)   Set cookie's path. More...
  void  CHttpCookie::SetExpirationTime (const CTime &exp_time)   Set expiration time, must be a GMT one. More...
  void  CHttpCookie::SetSecure (bool secure)   Set secure flag. More...
  void  CHttpCookie::SetHttpOnly (bool http_only)   Set HTTP-only flag. More...
  void  CHttpCookie::SetExtension (const CTempString &extension)   Any additional attributes (multiple attributes should be separated with semicolon). More...
  bool  CHttpCookie::IsExpired (void) const   Check if the cookie is currently expired. More...
  bool  CHttpCookie::IsExpired (const CTime &now) const   Check if the cookie has expired by "now". More...
  bool  CHttpCookie::Validate (void) const   Check if name, value, domain and path of the cookie are valid. More...
  string  CHttpCookie::AsString (ECookieFormat format) const   Compose string from the cookie. More...
  bool  CHttpCookie::Parse (const CTempString &str)   Read cookie from the string. More...
  bool  CHttpCookie::operator< (const CHttpCookie &cookie) const   Compare two cookies: More...
  bool  CHttpCookie::operator== (const CHttpCookie &cookie) const   Compare two cookies. More...
  bool  CHttpCookie::Match (const CUrl &url) const   Check if the cookie matches domain, path and scheme of the URL. More...
  bool  CHttpCookie::MatchDomain (const string &host) const   Helper method for string matching. More...
  bool  CHttpCookie::MatchPath (const string &path) const   'path' matches if it starts with 'cookie_path' and the last matching char or the first non-matching char is '/'. More...
  void  CHttpCookie::Reset (void)   Reset value and all attributes, keep just the name. More...
  static bool  CHttpCookie::IsValidValue (const string &value, EFieldType field, string *err_msg=NULL)   Check if the value can be safely used for the selected field. More...
  void  CHttpCookie::x_Validate (const string &value, EFieldType field) const   static int  CHttpCookie::sx_Compare (const CHttpCookie &c1, const CHttpCookie &c2)   virtual  CHttpCookies::~CHttpCookies (void)   void  CHttpCookies::Add (const CHttpCookie &cookie)   Add a single cookie. More...
  size_t  CHttpCookies::Add (ECookieHeader header, const CTempString &str, const CUrl *url)   Parse a single Cookie or Set-Cookie header, discard bad cookies. More...
  void  CHttpCookies::Cleanup (size_t max_count=0)   Cleanup cookies. More...
  const_iterator  CHttpCookies::begin (void) const   Iterate all cookies. More...
  const_iterator  CHttpCookies::begin (const CUrl &url) const   Iterate cookies matching the given URL. More...
  const_iterator  CHttpCookies::end (void) const   Empty iterator. More...
  bool  CHttpCookies::SDomainLess::operator() (const string &s1, const string &s2) const   CHttpCookieCHttpCookies::x_Find (const string &domain, const string &path, const string &name)   static string  CHttpCookies::sx_RevertDomain (const string &domain)     CHttpCookie_CI::CHttpCookie_CI (void)     CHttpCookie_CI::CHttpCookie_CI (const CHttpCookie_CI &other)   CHttpCookie_CICHttpCookie_CI::operator= (const CHttpCookie_CI &other)     CHttpCookie_CI::operator bool (void) const   bool  CHttpCookie_CI::operator== (const CHttpCookie_CI &other) const   bool  CHttpCookie_CI::operator!= (const CHttpCookie_CI &other) const   CHttpCookie_CICHttpCookie_CI::operator++ (void)   const CHttpCookieCHttpCookie_CI::operator* (void) const   const CHttpCookieCHttpCookie_CI::operator-> (void) const     CHttpCookie_CI::CHttpCookie_CI (const CHttpCookies &cookies, const CUrl *url)   bool  CHttpCookie_CI::x_IsValid (void) const   void  CHttpCookie_CI::x_CheckState (void) const   int  CHttpCookie_CI::x_Compare (const CHttpCookie_CI &other) const   void  CHttpCookie_CI::x_Next (void)   void  CHttpCookie_CI::x_Settle (void)   virtual const char *  CHttpCookieException::GetErrCodeString (void) const override   Get error code interpreted as text. More...
    CHttpCookieException::NCBI_EXCEPTION_DEFAULT (CHttpCookieException, CException)   ◆ const_iterator

Allow to use cookies with macros like ITERATE.

Definition at line 292 of file ncbi_cookies.hpp.

◆ TCookieList [1/2] ◆ TCookieList [2/2] ◆ TCookieMap [1/2] ◆ TCookieMap [2/2] ◆ TList_CI ◆ TMap_CI ◆ ECookieFormat

Whether the cookie is sent as a part of HTTP request or HTTP response.

Enumerator eHTTPResponse  eHTTPRequest 

Definition at line 146 of file ncbi_cookies.hpp.

◆ ECookieHeader

Cookie header type.

Enumerator eHeader_Cookie  eHeader_SetCookie 

Definition at line 255 of file ncbi_cookies.hpp.

◆ EErrCode ◆ EFieldType

Cookie field selector.

Enumerator eField_Name  eField_Value  eField_Domain  eField_Path  eField_Extension  eField_Other 

Definition at line 200 of file ncbi_cookies.hpp.

◆ Add() [1/2] ◆ Add() [2/2]

Parse a single Cookie or Set-Cookie header, discard bad cookies.

Parameters
header eHeader_Cookie: the string may contain multiple name/value pairs. eHeader_SetCookie: the method reads a single Set-Cookie line and matches the cookie using the url (if any) and discards the cookie if it does not pass matching. str String containing a single HTTP-response cookie or multiple HTTP-request cookies depending on 'header' value. The string must not contain 'Set-Cookie:' or 'Cookie:' text. url If not null, the parsed cookie is matched against the url. If an attribute does not pass matching (domain, path, secure, http-only) the whole cookie is discarded.
Returns
Number of cookies parsed successfully. In case of eHeader_SetCookie the returned value is always 1 or 0.

Definition at line 720 of file ncbi_cookies.cpp.

References CHttpCookies::Add(), CHttpCookies::Cleanup(), count, CHttpCookies::eHeader_Cookie, NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, CHttpCookie::GetDomain(), CUrl::GetHost(), CHttpCookie::GetName(), CHttpCookie::GetPath(), CUrl::GetPath(), CHttpCookie::IsExpired(), ITERATE, CHttpCookie::Match(), CHttpCookie::Parse(), CHttpCookie::SetDomain(), CHttpCookie::SetHostOnly(), CHttpCookie::SetPath(), NStr::Split(), str(), and CHttpCookies::x_Find().

◆ AsString()

Compose string from the cookie.

If quoting is enabled, the value is placed in double-quotes. NOTE that this method does not print 'Set-Cookie:' or 'Cookie:' header itself, just the cookie value.

Parameters
format

Definition at line 214 of file ncbi_cookies.cpp.

References CHttpCookie::eField_Domain, CHttpCookie::eField_Extension, CHttpCookie::eField_Name, CHttpCookie::eField_Path, CHttpCookie::eField_Value, CHttpCookie::eHTTPRequest, CHttpCookie::eHTTPResponse, format, CHttpCookie::GetExpirationStr(), CTime::IsEmpty(), CHttpCookie::m_Accessed, CHttpCookie::m_Domain, CHttpCookie::m_Expires, CHttpCookie::m_Extension, CHttpCookie::m_HttpOnly, CHttpCookie::m_Name, CHttpCookie::m_Path, CHttpCookie::m_Secure, CHttpCookie::m_Value, CTime::SetCurrent(), and CHttpCookie::x_Validate().

Referenced by CHttpSession_Base::x_GetCookies().

◆ begin() [1/2] ◆ begin() [2/2] ◆ CHttpCookie() [1/2] ◆ CHttpCookie() [2/2] CHttpCookie::CHttpCookie ( void  ) ◆ CHttpCookie_CI() [1/3] ◆ CHttpCookie_CI() [2/3]

Definition at line 878 of file ncbi_cookies.cpp.

References map_checker< Container >::begin(), map_checker< Container >::end(), CUrl::GetHost(), map_checker< Container >::lower_bound(), CHttpCookies::m_CookieMap, CHttpCookie_CI::m_Cookies, CHttpCookie_CI::m_ListIt, CHttpCookie_CI::m_MapIt, CHttpCookie_CI::m_Url, NULL, CHttpCookies::sx_RevertDomain(), and CHttpCookie_CI::x_Settle().

◆ CHttpCookie_CI() [3/3] ◆ Cleanup() void CHttpCookies::Cleanup ( size_t  max_count = 0 )

Cleanup cookies.

Remove the expired ones first, then if the remaining number of cookies is above the limit, remove domains containing most cookies until the total number is below the limit.

Definition at line 791 of file ncbi_cookies.cpp.

References _ASSERT, map_checker< Container >::clear(), count, map_checker< Container >::end(), map_checker< Container >::erase(), ERASE_ITERATE, map_checker< Container >::find(), ITERATE, CHttpCookies::m_CookieMap, and s_DomainCountLess().

Referenced by CHttpCookies::Add().

◆ end() ◆ GetDomain() ◆ GetErrCodeString() const char * CHttpCookieException::GetErrCodeString ( void  ) const overridevirtual ◆ GetExpirationStr() string CHttpCookie::GetExpirationStr ( void  ) const ◆ GetExpirationTime() const CTime & CHttpCookie::GetExpirationTime ( void  ) const inline ◆ GetExtension() const string & CHttpCookie::GetExtension ( void  ) const inline ◆ GetHostOnly() bool CHttpCookie::GetHostOnly ( void  ) const inline

Get host-only flag.

The flag is set if the incoming cookie contains no domain attribute. In this case the domain is set to the originating host but no domain matching is used and the cookie can be sent back only to the same domain.

Definition at line 432 of file ncbi_cookies.hpp.

References CHttpCookie::m_HostOnly.

◆ GetHttpOnly() bool CHttpCookie::GetHttpOnly ( void  ) const inline ◆ GetName() ◆ GetPath() ◆ GetSecure() bool CHttpCookie::GetSecure ( void  ) const inline ◆ GetValue() ◆ IsExpired() [1/2] ◆ IsExpired() [2/2] bool CHttpCookie::IsExpired ( void  ) const inline ◆ IsValidValue()

Check if the value can be safely used for the selected field.

If the value is not valid and err_msg is not NULL, save error description to the string.

Definition at line 114 of file ncbi_cookies.cpp.

References _ASSERT, CHttpCookie::eField_Domain, CHttpCookie::eField_Extension, CHttpCookie::eField_Name, CHttpCookie::eField_Path, CHttpCookie::eField_Value, isalnum(), iscntrl(), kBannedChars_Extension, kBannedChars_Name, kBannedChars_Path, kBannedChars_Value, NPOS, NStr::SizetToString(), string, and rapidjson::value.

Referenced by CHttpCookie::Parse(), CHttpCookie::Validate(), and CHttpCookie::x_Validate().

◆ Match() ◆ MatchDomain() ◆ MatchPath() ◆ NCBI_EXCEPTION_DEFAULT() ◆ operator bool() ◆ operator!=() ◆ operator()() ◆ operator*() ◆ operator++() ◆ operator->() ◆ operator<()

Compare two cookies:

Definition at line 306 of file ncbi_cookies.cpp.

References CHttpCookie::sx_Compare().

◆ operator=() ◆ operator==() [1/2] ◆ operator==() [2/2] ◆ Parse()

Read cookie from the string.

The string should not include 'Cookie:' or 'Set-Cookie:' header. In case of HTTP request cookies ('Cookie:' header) the input should contain only one name=value pair. Return true on success, false on error (bad symbols in name/value, invalid domain, inproper protocol etc. - see RFC-6265). Parsing errors are logged with 'Info' severity.

Definition at line 461 of file ncbi_cookies.cpp.

References CTime::AddSecond(), CTime::Clear(), CHttpCookie::eField_Domain, CHttpCookie::eField_Name, CHttpCookie::eField_Path, CHttpCookie::eField_Value, CTime::eGmt, NStr::EndsWith(), NStr::EqualNocase(), ERR_POST_X, ncbi::grid::netcache::search::fields::expires, NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, Info(), CTime::IsEmpty(), CHttpCookie::IsValidValue(), ITERATE, CHttpCookie::m_Accessed, CHttpCookie::m_Created, CHttpCookie::m_Domain, CHttpCookie::m_Expires, CHttpCookie::m_Extension, CHttpCookie::m_HostOnly, CHttpCookie::m_HttpOnly, CHttpCookie::m_Name, CHttpCookie::m_Path, CHttpCookie::m_Secure, CHttpCookie::m_Value, NPOS, s_ParseDateTime(), CTime::SetCurrent(), CTime::SetTimeZone(), NStr::Split(), str(), NStr::ToLower(), NStr::TruncateSpaces(), and rapidjson::value.

Referenced by CHttpCookies::Add().

◆ Reset() void CHttpCookie::Reset ( void  )

Reset value and all attributes, keep just the name.

Definition at line 682 of file ncbi_cookies.cpp.

References CTime::Clear(), CHttpCookie::m_Accessed, CHttpCookie::m_Created, CHttpCookie::m_Domain, CHttpCookie::m_Expires, CHttpCookie::m_Extension, CHttpCookie::m_HostOnly, CHttpCookie::m_HttpOnly, CHttpCookie::m_Path, CHttpCookie::m_Secure, and CHttpCookie::m_Value.

◆ SetDomain() ◆ SetExpirationTime() void CHttpCookie::SetExpirationTime ( const CTimeexp_time ) inline ◆ SetExtension()

Any additional attributes (multiple attributes should be separated with semicolon).

The string is appended to the cookie, semicolon-separated when converting it to a string.

Definition at line 501 of file ncbi_cookies.hpp.

References CHttpCookie::m_Extension.

◆ SetHostOnly() void CHttpCookie::SetHostOnly ( bool  host_only ) inline ◆ SetHttpOnly() void CHttpCookie::SetHttpOnly ( bool  http_only ) inline ◆ SetName()

Set cookie's name.

No validation is performed immediately, but if the value is invalid CHttpCookieExcepion will be thrown on an attempt to get the cookie as a string. The name is never encoded - the caller is responsible for providing a valid name.

See also
AsString()

Definition at line 462 of file ncbi_cookies.hpp.

References CHttpCookie::m_Name.

◆ SetPath() ◆ SetSecure() void CHttpCookie::SetSecure ( bool  secure ) inline ◆ SetValue()

Set cookie's value.

No validation is performed immediately, but if the value is invalid CHttpCookieExcepion will be thrown on an attempt to get the cookie as a string. The value is never encoded - the caller is responsible for providing a valid value.

See also
AsString()

Definition at line 467 of file ncbi_cookies.hpp.

References CHttpCookie::m_Value, and rapidjson::value.

◆ sx_Compare() ◆ sx_RevertDomain() ◆ Validate() bool CHttpCookie::Validate ( void  ) const

Check if name, value, domain and path of the cookie are valid.

Definition at line 318 of file ncbi_cookies.cpp.

References CHttpCookie::eField_Domain, CHttpCookie::eField_Extension, CHttpCookie::eField_Name, CHttpCookie::eField_Path, CHttpCookie::eField_Value, CHttpCookie::IsValidValue(), CHttpCookie::m_Domain, CHttpCookie::m_Extension, CHttpCookie::m_Name, CHttpCookie::m_Path, CHttpCookie::m_Value, and NULL.

◆ x_CheckState() void CHttpCookie_CI::x_CheckState ( void  ) const private ◆ x_Compare() ◆ x_Find() ◆ x_IsValid() bool CHttpCookie_CI::x_IsValid ( void  ) const private ◆ x_Next() void CHttpCookie_CI::x_Next ( void  ) private ◆ x_Settle() void CHttpCookie_CI::x_Settle ( void  ) private ◆ x_Validate() ◆ ~CHttpCookies() ◆ m_Accessed CTime CHttpCookie::m_Accessed mutableprivate ◆ m_CookieMap ◆ m_Cookies ◆ m_Created CTime CHttpCookie::m_Created private ◆ m_Domain ◆ m_Expires CTime CHttpCookie::m_Expires private ◆ m_Extension string CHttpCookie::m_Extension private ◆ m_HostOnly bool CHttpCookie::m_HostOnly private ◆ m_HttpOnly bool CHttpCookie::m_HttpOnly private ◆ m_ListIt ◆ m_MapIt ◆ m_Name ◆ m_Path ◆ m_Secure bool CHttpCookie::m_Secure private ◆ m_Url CUrl CHttpCookie_CI::m_Url private ◆ m_Value ◆ CHttpCookie ◆ CHttpCookie_CI ◆ CHttpCookies

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4