NCBI C++ ToolKit
|
Classes | |
struct | SGetHttpDefaultRetries |
class | CHttpHeaders |
class | CHttpHeaders::CHeaderNameConverter |
Helper class allowing to use both strings and enums as header names. More... | |
class | CHttpProxy |
Per-request proxy settings. More... | |
class | CHttpParam |
CHttpSession and CHttpRequest parameters. More... | |
class | CFormDataProvider_Base |
Interface for custom form data providers. More... | |
class | CHttpFormData |
POST request data. More... | |
struct | CHttpFormData::SFormData |
class | CHttpResponse |
HTTP response. More... | |
class | CTlsCertCredentials |
Wrapper class for NCBI_CRED. More... | |
class | CHttpRequest |
HTTP request. More... | |
class | CHttpRequest::CAdjustUrlCallback_Base |
class | CHttpRequest::CAdjustUrlCallback< TCallback > |
class | CHttpSession_Base |
HTTP session class, holding common data for multiple requests. More... | |
class | CHttpSession |
class | CHttpSessionException |
CHttpSessionException –. More... | |
Typedefs | |
typedef CNullable< unsigned short, SGetHttpDefaultRetries > | THttpRetries |
Nullable retries for CHttpRequest. More... | |
typedef vector< string > | CHttpHeaders::THeaderValues |
List of header values (may be required for headers with multiple values like Cookie). More... | |
typedef map< string, THeaderValues, PNocase > | CHttpHeaders::THeaders |
Map of header name-values, case-insensitive. More... | |
typedef vector< SFormData > | CHttpFormData::TValues |
typedef map< string, TValues > | CHttpFormData::TEntries |
typedef vector< CRef< CFormDataProvider_Base > > | CHttpFormData::TProviders |
typedef map< string, TProviders > | CHttpFormData::TProviderEntries |
Friends | |
class | CHttpHeaders::CHttpRequest |
class | CHttpHeaders::CHttpResponse |
class | CHttpFormData::CHttpRequest |
class | CHttpResponse::CHttpRequest |
class | CHttpRequest::CHttpSession_Base |
class | CHttpRequest::CHttpSession |
class | CHttpRequest::CHttp2Session |
class | CHttpSession_Base::CHttpRequest |
class | CHttpSession_Base::CHttpResponse |
|
private |
Definition at line 451 of file ncbi_http_session.hpp.
typedef map<string, THeaderValues, PNocase> CHttpHeaders::THeaders |
Map of header name-values, case-insensitive.
Definition at line 103 of file ncbi_http_session.hpp.
typedef vector<string> CHttpHeaders::THeaderValues |
List of header values (may be required for headers with multiple values like Cookie).
Definition at line 101 of file ncbi_http_session.hpp.
typedef CNullable<unsigned short, SGetHttpDefaultRetries> THttpRetries |
Nullable retries for CHttpRequest.
Definition at line 57 of file ncbi_http_session.hpp.
|
private |
Definition at line 453 of file ncbi_http_session.hpp.
|
private |
Definition at line 452 of file ncbi_http_session.hpp.
|
private |
Definition at line 450 of file ncbi_http_session.hpp.
Supported content types for POST requests.
Enumerator | |
---|---|
eFormUrlEncoded | 'application/x-www-form-urlencoded', default |
eMultipartFormData | 'multipart/form-data' |
Definition at line 359 of file ncbi_http_session.hpp.
Definition at line 843 of file ncbi_http_session.hpp.
Some standard HTTP headers.
Enumerator | |
---|---|
eCacheControl | |
eContentLength | |
eContentType | |
eCookie | |
eDate | |
eExpires | |
eLocation | |
eRange | |
eReferer | |
eSetCookie | |
eUserAgent | |
eHost |
Definition at line 67 of file ncbi_http_session.hpp.
HTTP protocol version.
Enumerator | |
---|---|
eHTTP_10 | HTTP/1.0. |
eHTTP_11 | HTTP/1.1. |
eHTTP_2 | HTTP/2. |
Definition at line 764 of file ncbi_http_session.hpp.
Supported request methods, proxy for EReqMethod.
Enumerator | |
---|---|
eHead | |
eGet | |
ePost | |
ePut | |
ePatch | |
eDelete |
Definition at line 703 of file ncbi_http_session.hpp.
void CHttpFormData::AddEntry | ( | CTempString | entry_name, |
CTempString | value, | ||
CTempString | content_type = CTempString() |
||
) |
Add name=value pair.
The data of this type can be sent using either eFormUrlEncoded or eMultipartFormData content types.
entry_name | Name of the form input. The name must not be empty, otherwise an exception is thrown. Multiple values with the same name are allowed. |
value | Value for the input. If the form content type is eFormUrlEncoded, the value will be URL encoded properly. Otherwise the value is sent as-is. URL-encoded form data allows only one value per entry, otherwise exception will be thrown when sending the data. |
content_type | Content type for the entry used if the form content type is eMultipartFormData. If not set, the protocol assumes 'text/plain' content type. Not used when sending eFormUrlEncoded content. |
Definition at line 247 of file ncbi_http_session.cpp.
References CTempString::empty(), CHttpFormData::SFormData::m_ContentType, CHttpFormData::m_Entries, CHttpFormData::SFormData::m_Value, NCBI_THROW, and rapidjson::value.
void CHttpFormData::AddFile | ( | CTempString | entry_name, |
CTempString | file_name, | ||
CTempString | content_type = CTempString() |
||
) |
Add file entry.
The form content type is automatically set to eMultipartFormData and can not be changed later.
entry_name | Name of the form input responsible for selecting files. Multiple files can be added with the same entry name. The name must not be empty, otherwise an exception is thrown. |
file_name | Path to the local file to be sent. The file must exist and be readable during the call to WriteFormData, otherwise an exception will be thrown. |
content_type | Can be used to set content type for each file. If not set, the protocol assumes it to be 'application/octet-stream'. |
Definition at line 311 of file ncbi_http_session.cpp.
References CHttpFormData::AddProvider(), and file_name.
CHttpParam & CHttpParam::AddHeader | ( | CHttpHeaders::EHeaderName | header, |
CTempString | value | ||
) |
Add a single HTTP header,.
Definition at line 1259 of file ncbi_http_session.cpp.
References CHttpHeaders::AddValue(), CHttpParam::m_Headers, and rapidjson::value.
void CHttpFormData::AddProvider | ( | CTempString | entry_name, |
CFormDataProvider_Base * | provider | ||
) |
Add custom data provider.
The data written by the provider is properly prefixed with Content-Disposition, boundary, Content-Type etc. The form content type is automatically set to eMultipartFormData and can not be changed later.
entry_name | Name of the form input responsible for the data. Multiple providers can be added with the same entry name. The name must not be empty, otherwise an exception is thrown. |
provider | An instance of CFormDataProvider_Base derived class. The object must be created in heap. |
Definition at line 263 of file ncbi_http_session.cpp.
References CTempString::empty(), CHttpFormData::eMultipartFormData, CHttpFormData::m_ContentType, CHttpFormData::m_Providers, NCBI_THROW, and Ref().
Referenced by CHttpFormData::AddFile().
void CHttpHeaders::AddValue | ( | CHeaderNameConverter | name, |
CTempString | value | ||
) |
Add new value with the name (multiple values are allowed with the same name, the order is preserved).
Throw exception if the name is a reserved one and can not be set directly (NCBI-SID, NCBI-PHID). These values should be set through CRequestContext, the headers will be added by CConn_HttpStream automatically.
Definition at line 126 of file ncbi_http_session.cpp.
References _VERIFY, CHttpHeaders::CHeaderNameConverter::GetName(), CHttpHeaders::m_Headers, rapidjson::value, and CHttpHeaders::x_IsReservedHeader().
Referenced by CHttpParam::AddHeader().
|
inlinevirtual |
Implements CHttpRequest::CAdjustUrlCallback_Base.
Definition at line 648 of file ncbi_http_session.hpp.
References CHttpRequest::CAdjustUrlCallback< TCallback >::m_Callback.
Implemented in CHttpRequest::CAdjustUrlCallback< TCallback >.
void CHttpHeaders::Assign | ( | const CHttpHeaders & | headers | ) |
Clear any existing values and copy all headers from 'headers' to this object.
Definition at line 190 of file ncbi_http_session.cpp.
References map_checker< Container >::clear(), CHttpHeaders::m_Headers, and CHttpHeaders::Merge().
Referenced by SRetryProcessing::Assign(), and CHttpParam::SetHeaders().
|
inline |
Definition at line 647 of file ncbi_http_session.hpp.
bool CHttpResponse::CanGetContentStream | ( | void | ) | const |
Check if the requested content can be read from the content stream.
This is true for status codes 2xx. If there's no content available, ContentStream() will throw an exception and response body can be accessed using ErrorStream().
Definition at line 504 of file ncbi_http_session.cpp.
References CHttpResponse::m_StatusCode.
Referenced by CHttpResponse::ContentStream(), CHttpResponse::ErrorStream(), CHttpSessionApp::PrintResponse(), and s_UpdateLocalFile().
|
inline |
Definition at line 92 of file ncbi_http_session.hpp.
|
inline |
Definition at line 86 of file ncbi_http_session.hpp.
Definition at line 88 of file ncbi_http_session.hpp.
|
inline |
Definition at line 90 of file ncbi_http_session.hpp.
|
private |
|
private |
Definition at line 230 of file ncbi_http_session.cpp.
|
private |
|
inline |
Create empty headers list.
Definition at line 64 of file ncbi_http_session.hpp.
CHttpParam::CHttpParam | ( | void | ) |
Definition at line 1236 of file ncbi_http_session.cpp.
|
inline |
Definition at line 188 of file ncbi_http_session.hpp.
Definition at line 190 of file ncbi_http_session.hpp.
|
inline |
Definition at line 187 of file ncbi_http_session.hpp.
|
private |
Definition at line 572 of file ncbi_http_session.cpp.
References CHttpRequest::SetParam().
|
private |
Definition at line 465 of file ncbi_http_session.cpp.
|
inline |
Definition at line 817 of file ncbi_http_session.hpp.
CHttpSession_Base::CHttpSession_Base | ( | EProtocol | protocol | ) |
Definition at line 1133 of file ncbi_http_session.cpp.
void CHttpHeaders::Clear | ( | CHeaderNameConverter | name | ) |
Remove all values with the given name.
Definition at line 134 of file ncbi_http_session.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), CHttpHeaders::CHeaderNameConverter::GetName(), and CHttpHeaders::m_Headers.
void CHttpFormData::Clear | ( | void | ) |
Clear all form data, reset content type to the default eFormUrlEncoded.
Definition at line 319 of file ncbi_http_session.cpp.
References map_checker< Container >::clear(), CHttpFormData::CreateBoundary(), CHttpFormData::eFormUrlEncoded, CHttpFormData::m_Boundary, CHttpFormData::m_ContentType, CHttpFormData::m_Entries, and CHttpFormData::m_Providers.
void CHttpHeaders::ClearAll | ( | void | ) |
Remove all headers.
Definition at line 143 of file ncbi_http_session.cpp.
References map_checker< Container >::clear(), and CHttpHeaders::m_Headers.
CNcbiOstream & CHttpRequest::ContentStream | ( | void | ) |
Get output stream to write user data.
Headers are sent automatically when opening the stream. No changes can be made to the request after getting the stream until it is completed by calling Execute(). Throws an exception if the selected request method does not support sending data or if the existing form data is not empty.
Definition at line 742 of file ncbi_http_session.cpp.
References _ASSERT, CHttpSession_Base::GetProtocol(), CHttpRequest::m_Response, CHttpRequest::m_Session, CHttpRequest::m_Stream, NCBI_THROW, CHttpRequest::x_CanSendData(), and CHttpSession_Base::x_StartRequest().
Referenced by g_HttpPost(), g_HttpPut(), SFileTrackAPI::GetPath(), CHttpSession_Base::Post(), CHttpSession_Base::Put(), SFileTrackUpload::RenameFile(), and CHttpSessionApp::Run().
CNcbiIstream & CHttpResponse::ContentStream | ( | void | ) | const |
Get input stream.
If the status code indicates that there's no content to be read, throw CHttpSessionException. The actual request body (e.g. error page) can be read using ErrorStream().
Definition at line 478 of file ncbi_http_session.cpp.
References _ASSERT, CHttpResponse::CanGetContentStream(), CHttpResponse::m_StatusCode, CHttpResponse::m_StatusText, CHttpResponse::m_Stream, NCBI_THROW, and NStr::NumericToString().
Referenced by CBiosampleChkApp::CreateBiosampleUpdateWebService(), CCompareWithBiosample::CreateBiosampleUpdateWebService(), SFileTrackAPI::GetPath(), CDoiLookup::GetPubFromCrossRef(), CGuiHttpSessionRequest::GetResponseStream(), CHttpSessionApp::PrintResponse(), s_GetCubbyUserName(), and s_UpdateLocalFile().
|
inline |
Get all stored cookies, non-const.
Definition at line 761 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_Cookies.
|
inline |
Get all stored cookies.
Definition at line 759 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_Cookies.
Referenced by CHttpSessionApp::PrintResponse().
size_t CHttpHeaders::CountValues | ( | CHeaderNameConverter | name | ) | const |
Get number of values with the given name.
Definition at line 91 of file ncbi_http_session.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), CHttpHeaders::CHeaderNameConverter::GetName(), and CHttpHeaders::m_Headers.
|
static |
Generate a new random string to be used as multipart boundary.
Definition at line 358 of file ncbi_http_session.cpp.
References i, and s_SimpleRand().
Referenced by CHttpFormData::Clear(), and CHttpFormData::WriteFormData().
CTlsCertCredentials::CTlsCertCredentials | ( | const CTempStringEx & | cert, |
const CTempStringEx & | pkey | ||
) |
Initialize credentials.
The arguments are passed to NcbiCreateTlsCertCredentials.
Definition at line 526 of file ncbi_http_session.cpp.
References CTempStringEx::HasZeroAtEnd(), CTlsCertCredentials::m_Cert, and CTlsCertCredentials::m_PKey.
|
private |
CNcbiIstream & CHttpResponse::ErrorStream | ( | void | ) | const |
Get input stream containing error message (e.g.
404 page) If the status code indicates that valid content is available the method throws CHttpSessionException.
Definition at line 491 of file ncbi_http_session.cpp.
References _ASSERT, CHttpResponse::CanGetContentStream(), CHttpResponse::m_StatusCode, CHttpResponse::m_StatusText, CHttpResponse::m_Stream, NCBI_THROW, and NStr::NumericToString().
Referenced by CBiosampleChkApp::CreateBiosampleUpdateWebService(), CCompareWithBiosample::CreateBiosampleUpdateWebService(), and CHttpSessionApp::PrintResponse().
CHttpResponse CHttpRequest::Execute | ( | void | ) |
Send the request, initialize and return the response.
The output content stream is flushed and closed by this call. After executing a request it can be modified (e.g. more headers and/or form data added) and re-executed.
Definition at line 706 of file ncbi_http_session.cpp.
References _ASSERT, CRef< C, Locker >::Empty(), CHttpSession_Base::GetProtocol(), CHttpResponse::Headers(), CHttpRequest::m_Deadline, CHttpRequest::m_FormData, CHttpRequest::m_Headers, CHttpRequest::m_Method, CHttpRequest::m_Response, CHttpRequest::m_RetryProcessing, CHttpRequest::m_Session, CHttpRequest::m_Stream, CHttpRequest::m_Url, NCBI_THROW, CRef< C, Locker >::Reset(), CHttpFormData::WriteFormData(), CHttpSession_Base::x_Downgrade(), and CHttpSession_Base::x_StartRequest().
Referenced by CGuiHttpSessionRequest::CGuiHttpSessionRequest(), g_HttpGet(), g_HttpPost(), g_HttpPut(), CHttpSession_Base::Get(), SFileTrackAPI::GetPath(), CHttpSession_Base::Post(), CHttpSession_Base::Put(), SFileTrackAPI::Remove(), SFileTrackUpload::RenameFile(), and CHttpSessionApp::Run().
CHttpFormData & CHttpRequest::FormData | ( | void | ) |
Get form data to be sent with POST request.
Throw an exception if the selected method is not POST or if the request is already being executed (after calling ContentStream() but before Execute()).
Definition at line 762 of file ncbi_http_session.cpp.
References CHttpRequest::m_FormData, CHttpRequest::m_Stream, NCBI_THROW, CRef< C, Locker >::Reset(), and CHttpRequest::x_CanSendData().
Referenced by CHttpSessionApp::Run().
CHttpResponse g_HttpGet | ( | const CUrl & | url, |
const CHttpHeaders & | headers, | ||
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for GET request with custom headers.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1305 of file ncbi_http_session.cpp.
References CHttpSession_Base::eGet, CHttpRequest::Execute(), CHttpRequest::Headers(), CHttpHeaders::Merge(), CHttpSession_Base::NewRequest(), CHttpRequest::SetRetries(), and CHttpRequest::SetTimeout().
CHttpResponse g_HttpGet | ( | const CUrl & | url, |
const CHttpParam & | param | ||
) |
Shortcut for GET request.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1287 of file ncbi_http_session.cpp.
References CHttpSession_Base::eGet, CHttpRequest::Execute(), CHttpParam::GetCredentials(), CHttpSession_Base::NewRequest(), and CHttpSession_Base::SetCredentials().
Referenced by g_HttpGet(), CUrlUtils::GetRemoteFileSize(), CHttpSessionApp::Run(), and s_UpdateLocalFile().
CHttpResponse g_HttpGet | ( | const CUrl & | url, |
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for GET request.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1296 of file ncbi_http_session.cpp.
References g_HttpGet().
CHttpResponse g_HttpPost | ( | const CUrl & | url, |
const CHttpHeaders & | headers, | ||
CTempString | data, | ||
CTempString | content_type = CTempString() , |
||
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for POST request with custom headers.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1351 of file ncbi_http_session.cpp.
References CHttpRequest::ContentStream(), data, CHttpHeaders::eContentType, CTempString::empty(), CHttpSession_Base::ePost, CHttpRequest::Execute(), CHttpHeaders::GetValue(), CHttpHeaders::HasValue(), CHttpRequest::Headers(), kContentType_FormUrlEnc, CHttpHeaders::Merge(), CHttpSession_Base::NewRequest(), CHttpRequest::SetRetries(), CHttpRequest::SetTimeout(), and CHttpHeaders::SetValue().
CHttpResponse g_HttpPost | ( | const CUrl & | url, |
CTempString | data, | ||
const CHttpParam & | param = CHttpParam() |
||
) |
Shortcut for POST request.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1319 of file ncbi_http_session.cpp.
References CHttpRequest::ContentStream(), data, CHttpHeaders::eContentType, CHttpSession_Base::ePost, CHttpRequest::Execute(), CHttpParam::GetCredentials(), CHttpParam::GetHeaders(), CHttpHeaders::HasValue(), CHttpRequest::Headers(), kContentType_FormUrlEnc, CHttpSession_Base::NewRequest(), CHttpSession_Base::SetCredentials(), and CHttpHeaders::SetValue().
Referenced by CBiosampleChkApp::CreateBiosampleUpdateWebService(), CCompareWithBiosample::CreateBiosampleUpdateWebService(), g_HttpPost(), and CHttpSessionApp::Run().
CHttpResponse g_HttpPost | ( | const CUrl & | url, |
CTempString | data, | ||
CTempString | content_type, | ||
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for POST request.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1340 of file ncbi_http_session.cpp.
References data, and g_HttpPost().
CHttpResponse g_HttpPut | ( | const CUrl & | url, |
const CHttpHeaders & | headers, | ||
CTempString | data, | ||
CTempString | content_type = CTempString() , |
||
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for PUT request with custom headers.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1418 of file ncbi_http_session.cpp.
References CHttpRequest::ContentStream(), data, CHttpHeaders::eContentType, CTempString::empty(), CHttpSession_Base::ePut, CHttpRequest::Execute(), CHttpHeaders::GetValue(), CHttpHeaders::HasValue(), CHttpRequest::Headers(), kContentType_FormUrlEnc, CHttpHeaders::Merge(), CHttpSession_Base::NewRequest(), CHttpRequest::SetRetries(), CHttpRequest::SetTimeout(), and CHttpHeaders::SetValue().
CHttpResponse g_HttpPut | ( | const CUrl & | url, |
CTempString | data, | ||
const CHttpParam & | param = CHttpParam() |
||
) |
Shortcut for PUT request.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1386 of file ncbi_http_session.cpp.
References CHttpRequest::ContentStream(), data, CHttpHeaders::eContentType, CHttpSession_Base::ePut, CHttpRequest::Execute(), CHttpParam::GetCredentials(), CHttpParam::GetHeaders(), CHttpHeaders::HasValue(), CHttpRequest::Headers(), kContentType_FormUrlEnc, CHttpSession_Base::NewRequest(), CHttpSession_Base::SetCredentials(), and CHttpHeaders::SetValue().
Referenced by g_HttpPut().
CHttpResponse g_HttpPut | ( | const CUrl & | url, |
CTempString | data, | ||
CTempString | content_type, | ||
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for PUT request.
Each request uses a separate session, no data like cookies is shared between multiple requests.
Definition at line 1407 of file ncbi_http_session.cpp.
References data, and g_HttpPut().
Definition at line 176 of file ncbi_http_session.hpp.
References CHttpHeaders::m_Headers.
Referenced by CUrlUtils::GetRemoteFileSize(), CHttpSessionApp::PrintResponse(), and CHttp2Session::x_StartRequest().
CHttpResponse CHttpSession_Base::Get | ( | const CUrl & | url, |
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for GET requests.
url | URL to send request to. |
Definition at line 1146 of file ncbi_http_session.cpp.
References CHttpSession_Base::eGet, CHttpRequest::Execute(), CHttpSession_Base::NewRequest(), CHttpRequest::SetRetries(), and CHttpRequest::SetTimeout().
Referenced by CDoiLookup::GetPubFromCrossRef(), CUsageReportJob::Run(), s_GetCubbyUserName(), and CUsageReport::x_Send().
const CHttpHeaders::THeaderValues & CHttpHeaders::GetAllValues | ( | CHeaderNameConverter | name | ) | const |
Get all values with the given name.
Definition at line 108 of file ncbi_http_session.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), CHttpHeaders::CHeaderNameConverter::GetName(), kEmptyValues, and CHttpHeaders::m_Headers.
Referenced by CHttpResponse::x_Update().
Definition at line 539 of file ncbi_http_session.hpp.
References CTlsCertCredentials::m_Cert.
|
inlinevirtual |
Get content type.
Returns empty string by default, indicating no Content-Type header should be used for the part.
Reimplemented in CTestDataProvider, and CFileDataProvider.
Definition at line 342 of file ncbi_http_session.hpp.
References string.
|
inline |
Get current content type.
Definition at line 425 of file ncbi_http_session.hpp.
References CHttpFormData::m_ContentType.
string CHttpFormData::GetContentTypeStr | ( | void | ) | const |
Get the form content type as a string.
Definition at line 328 of file ncbi_http_session.cpp.
References _ASSERT, CHttpFormData::eFormUrlEncoded, CHttpFormData::eMultipartFormData, kContentType_FormUrlEnc, kContentType_MultipartFormData, CHttpFormData::m_Boundary, and CHttpFormData::m_ContentType.
Referenced by CHttpRequest::x_AdjustHeaders().
|
inline |
Definition at line 232 of file ncbi_http_session.hpp.
References CHttpParam::m_Credentials.
Referenced by g_HttpGet(), g_HttpPost(), and g_HttpPut().
|
inline |
Definition at line 785 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_Credentials.
Definition at line 237 of file ncbi_http_session.hpp.
References CHttpParam::m_Deadline.
Referenced by CHttpRequest::SetParam().
Get current deadline for Execute().
For now, effective only if waiting for actual response (as opposed to a recognized 'retry later' response), infinite by default.
Definition at line 599 of file ncbi_http_session.hpp.
References CHttpRequest::m_Deadline.
|
overridevirtual |
Get error code interpreted as text.
Reimplemented from CException.
Definition at line 1458 of file ncbi_http_session.cpp.
References CHttpSessionException::eBadContentType, CHttpSessionException::eBadFormData, CHttpSessionException::eBadFormDataName, CHttpSessionException::eBadRequest, CHttpSessionException::eBadStream, CHttpSessionException::eConnFailed, CHttpSessionException::eOther, CException::GetErrCode(), and CException::GetErrCodeString().
|
inlinevirtual |
Get optional filename to be shown in Content-Disposition header.
Reimplemented in CTestDataProvider, and CFileDataProvider.
Definition at line 345 of file ncbi_http_session.hpp.
References string.
|
static |
Get string representation of the given name.
Definition at line 78 of file ncbi_http_session.cpp.
References _ASSERT, and kHttpHeaderNames.
|
inline |
Definition at line 223 of file ncbi_http_session.hpp.
References CHttpParam::m_Headers.
Referenced by g_HttpPost(), g_HttpPut(), and CHttpRequest::SetParam().
Definition at line 194 of file ncbi_http_session.hpp.
References CHttpProxy::m_Host.
Referenced by CHttpRequest::x_SetProxy().
|
inline |
Get flags passed to CConn_HttpStream.
Definition at line 776 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_HttpFlags.
Referenced by CHttpRequest::x_InitConnection().
string CHttpHeaders::GetHttpHeader | ( | void | ) | const |
Get all headers as a single string as required by CConn_HttpStream.
Each header line is terminated by a single HTTP_EOL.
Definition at line 178 of file ncbi_http_session.cpp.
References HTTP_EOL, ITERATE, kHttpHeaderDelimiter, CHttpHeaders::m_Headers, and val.
Referenced by CHttpRequest::sx_Adjust(), and CHttpRequest::x_InitConnection().
Get actual resource location.
This may be different from the requested URL in case of redirects.
Definition at line 492 of file ncbi_http_session.hpp.
References CHttpResponse::m_Location.
|
inline |
Definition at line 94 of file ncbi_http_session.hpp.
References CHttpHeaders::CHeaderNameConverter::m_Name.
Referenced by CHttpHeaders::AddValue(), CHttpHeaders::Clear(), CHttpHeaders::CountValues(), CHttpHeaders::GetAllValues(), CHttpHeaders::GetValue(), CHttpHeaders::HasValue(), and CHttpHeaders::SetValue().
NCBI_CRED CTlsCertCredentials::GetNcbiCred | ( | void | ) | const |
Definition at line 541 of file ncbi_http_session.cpp.
References CTlsCertCredentials::m_Cert, CTlsCertCredentials::m_Cred, CTlsCertCredentials::m_PKey, and NcbiCreateTlsCertCredentials().
Definition at line 197 of file ncbi_http_session.hpp.
References CHttpProxy::m_Password.
Referenced by CHttpRequest::x_SetProxy().
Definition at line 540 of file ncbi_http_session.hpp.
References CTlsCertCredentials::m_PKey.
|
inline |
Definition at line 195 of file ncbi_http_session.hpp.
References CHttpProxy::m_Port.
Referenced by CHttpRequest::x_SetProxy().
|
inline |
Get protocol version.
Definition at line 771 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_Protocol.
Referenced by CHttpRequest::ContentStream(), CHttpRequest::Execute(), and CHttpRequest::x_InitConnection().
|
inline |
Definition at line 235 of file ncbi_http_session.hpp.
References CHttpParam::m_Proxy.
Referenced by CHttpRequest::SetParam().
|
inline |
Definition at line 625 of file ncbi_http_session.hpp.
References CHttpRequest::m_Proxy.
Referenced by CHttpRequest::x_SetProxy().
|
inline |
Definition at line 791 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_Proxy.
Referenced by CHttpRequest::x_SetProxy().
|
inline |
Definition at line 229 of file ncbi_http_session.hpp.
References CHttpParam::m_Retries.
Referenced by CHttpRequest::SetParam().
|
inline |
Get number of retries.
If not set returns the global default value ($CONN_MAX_TRY - 1).
Definition at line 590 of file ncbi_http_session.hpp.
References CHttpRequest::m_Retries.
|
inline |
Definition at line 240 of file ncbi_http_session.hpp.
References CHttpParam::m_RetryProcessing.
Referenced by CHttpRequest::SetParam().
|
inline |
Return whether Execute() will wait for actual response.
If on, will wait for deadline expired or actual response (as opposed to a recognized 'retry later' response), off by default.
Definition at line 608 of file ncbi_http_session.hpp.
References CHttpRequest::m_RetryProcessing.
|
inline |
Get response status code.
Definition at line 495 of file ncbi_http_session.hpp.
References CHttpResponse::m_StatusCode.
Referenced by CBiosampleChkApp::CreateBiosampleUpdateWebService(), CCompareWithBiosample::CreateBiosampleUpdateWebService(), CDoiLookup::GetPubFromCrossRef(), CUrlUtils::GetRemoteFileSize(), CHttpSessionApp::PrintResponse(), CUsageReportJob::Run(), s_GetCubbyUserName(), s_UpdateLocalFile(), CHttpRequest::sx_Adjust(), CHttp2Session::x_Downgrade(), and CUsageReport::x_Send().
Get response status text.
Definition at line 498 of file ncbi_http_session.hpp.
References CHttpResponse::m_StatusText.
Referenced by CDoiLookup::GetPubFromCrossRef(), and CHttpSessionApp::PrintResponse().
Definition at line 226 of file ncbi_http_session.hpp.
References CHttpParam::m_Timeout.
Referenced by CHttpRequest::SetParam().
Get current timeout.
If set to CTimeout::eDefault, the global default value is used (or the one from $CONN_TIMEOUT).
Definition at line 582 of file ncbi_http_session.hpp.
References CHttpRequest::m_Timeout.
Definition at line 196 of file ncbi_http_session.hpp.
References CHttpProxy::m_User.
Referenced by CHttpRequest::x_SetProxy().
const string & CHttpHeaders::GetValue | ( | CHeaderNameConverter | name | ) | const |
Get value of the header or empty string.
If multiple values exist, return the last one.
Definition at line 99 of file ncbi_http_session.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), CHttpHeaders::CHeaderNameConverter::GetName(), kEmptyStr, and CHttpHeaders::m_Headers.
Referenced by g_HttpPost(), g_HttpPut(), SRetryProcessing::operator()(), and CHttpRequest::SetParam().
bool CHttpHeaders::HasValue | ( | CHeaderNameConverter | name | ) | const |
Check if there's at least one header with the name.
Definition at line 85 of file ncbi_http_session.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), CHttpHeaders::CHeaderNameConverter::GetName(), and CHttpHeaders::m_Headers.
Referenced by g_HttpPost(), g_HttpPut(), and CHttpRequest::SetParam().
|
inline |
Get HTTP headers to be sent.
Definition at line 557 of file ncbi_http_session.hpp.
References CHttpRequest::m_Headers.
Referenced by g_HttpGet(), g_HttpPost(), g_HttpPut(), SFileTrackAPI::GetPath(), CHttpSession_Base::Post(), CHttpSession_Base::Put(), SFileTrackAPI::Remove(), SFileTrackUpload::RenameFile(), CHttpSessionApp::Run(), and CHttpRequest::SetParam().
|
inline |
Get incoming HTTP headers.
Definition at line 478 of file ncbi_http_session.hpp.
References CHttpResponse::m_Headers.
Referenced by CHttpRequest::Execute(), CUrlUtils::GetRemoteFileSize(), and CHttpSessionApp::PrintResponse().
|
inline |
Definition at line 193 of file ncbi_http_session.hpp.
References CHttpProxy::m_Host.
Referenced by CHttpRequest::x_SetProxy().
bool CHttpFormData::IsEmpty | ( | void | ) | const |
Check if the form data is empty (no entries have been added).
Definition at line 454 of file ncbi_http_session.cpp.
References map_checker< Container >::empty(), CHttpFormData::m_Entries, and CHttpFormData::m_Providers.
void CHttpHeaders::Merge | ( | const CHttpHeaders & | headers | ) |
Add values from 'headers' to this object.
When merging values with the same name, the new values are added after the existing ones, so that the new values have higher priority.
Definition at line 197 of file ncbi_http_session.cpp.
References ITERATE, and CHttpHeaders::m_Headers.
Referenced by CHttpHeaders::Assign(), g_HttpGet(), g_HttpPost(), g_HttpPut(), and CHttpRequest::SetParam().
CHttpSessionException::NCBI_EXCEPTION_DEFAULT | ( | CHttpSessionException | , |
CException | |||
) |
CHttpRequest CHttpSession_Base::NewRequest | ( | const CUrl & | url, |
ERequestMethod | method = eGet , |
||
const CHttpParam & | param = {} |
||
) |
Initialize request.
This does not open connection to the server. A user can set headers/form-data before opening the stream and sending the actual request. The default request method is GET.
Definition at line 1140 of file ncbi_http_session.cpp.
References CHttpSession_Base::CHttpRequest.
Referenced by CGuiHttpSessionRequest::CGuiHttpSessionRequest(), g_HttpGet(), g_HttpPost(), g_HttpPut(), CHttpSession_Base::Get(), SFileTrackAPI::GetPath(), CHttpSession_Base::Post(), CHttpSession_Base::Put(), SFileTrackAPI::Remove(), SFileTrackUpload::RenameFile(), and CHttpSessionApp::Run().
unsigned short SGetHttpDefaultRetries::operator() | ( | void | ) | const |
Definition at line 555 of file ncbi_http_session.cpp.
References buf, ConnNetInfo_GetValueInternal(), DEF_CONN_MAX_TRY, NCBI_AS_STRING, and REG_CONN_MAX_TRY.
|
private |
|
private |
|
private |
void CHttpHeaders::ParseHttpHeader | ( | const CTempString & | headers | ) |
Parse headers from the string (usually provided by a stream callback).
The new headers are added to the existing ones.
Definition at line 172 of file ncbi_http_session.cpp.
References CHttpHeaders::m_Headers, and s_ParseHttpHeader().
CHttpResponse CHttpSession_Base::Post | ( | const CUrl & | url, |
CTempString | data, | ||
CTempString | content_type = CTempString() , |
||
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for POST requests.
url | URL to send request to. |
data | Data to be sent with the request. The data is sent as-is, any required encoding must be performed by the caller. |
content_type | Content-type. If empty, application/x-www-form-urlencoded is used. |
Definition at line 1157 of file ncbi_http_session.cpp.
References CHttpRequest::ContentStream(), data, CHttpHeaders::eContentType, CTempString::empty(), CHttpSession_Base::ePost, CHttpRequest::Execute(), CHttpRequest::Headers(), kContentType_FormUrlEnc, CHttpSession_Base::NewRequest(), CHttpRequest::SetRetries(), CHttpRequest::SetTimeout(), and CHttpHeaders::SetValue().
CHttpResponse CHttpSession_Base::Put | ( | const CUrl & | url, |
CTempString | data, | ||
CTempString | content_type = CTempString() , |
||
const CTimeout & | timeout = CTimeout(CTimeout::eDefault) , |
||
THttpRetries | retries = null |
||
) |
Shortcut for PUT requests.
url | URL to send request to. |
data | Data to be sent with the request. The data is sent as-is, any required encoding must be performed by the caller. |
content_type | Content-type. If empty, application/x-www-form-urlencoded is used. |
Definition at line 1177 of file ncbi_http_session.cpp.
References CHttpRequest::ContentStream(), data, CHttpHeaders::eContentType, CTempString::empty(), CHttpSession_Base::ePut, CHttpRequest::Execute(), CHttpRequest::Headers(), kContentType_FormUrlEnc, CHttpSession_Base::NewRequest(), CHttpRequest::SetRetries(), CHttpRequest::SetTimeout(), and CHttpHeaders::SetValue().
|
inline |
Set callback to adjust URL after resolving service location.
The callback must take a CUrl reference and return bool: bool AdjustUrlCallback(CUrl& url); The callback should return true for the adjusted URL to be used to make the request, or false if the changes should be discarded.
Definition at line 619 of file ncbi_http_session.hpp.
References CHttpRequest::m_AdjustUrl.
void CHttpFormData::SetContentType | ( | EContentType | content_type | ) |
Set content type for the form data.
If the new content type conflicts with the types of entries already added, throw an exception (e.g. files/providers require eMultipartFormData content type).
Definition at line 237 of file ncbi_http_session.cpp.
References map_checker< Container >::empty(), CHttpFormData::eMultipartFormData, CHttpFormData::m_ContentType, CHttpFormData::m_Providers, and NCBI_THROW.
void CHttpSession_Base::SetCredentials | ( | shared_ptr< CTlsCertCredentials > | cred | ) |
Set TLS credentials.
Definition at line 1226 of file ncbi_http_session.cpp.
References eOther, CHttpSession_Base::m_Credentials, and NCBI_THROW.
Referenced by g_HttpGet(), g_HttpPost(), g_HttpPut(), and CHttpSessionApp::Run().
CHttpParam & CHttpParam::SetCredentials | ( | shared_ptr< CTlsCertCredentials > | credentials | ) |
Definition at line 1280 of file ncbi_http_session.cpp.
References CHttpParam::m_Credentials.
Referenced by CHttpSessionApp::SetupParam().
|
inline |
Definition at line 238 of file ncbi_http_session.hpp.
References CHttpParam::m_Deadline.
Referenced by CHttpSessionApp::SetupParam().
CHttpRequest & CHttpRequest::SetDeadline | ( | const CTimeout & | deadline | ) |
Set new deadline for Execute().
Definition at line 1099 of file ncbi_http_session.cpp.
References CHttpRequest::m_Deadline.
Referenced by CGuiHttpSessionRequest::CGuiHttpSessionRequest().
CHttpParam & CHttpParam::SetHeader | ( | CHttpHeaders::EHeaderName | header, |
CTempString | value | ||
) |
Set or replace a single HTTP header,.
Definition at line 1252 of file ncbi_http_session.cpp.
References CHttpParam::m_Headers, CHttpHeaders::SetValue(), and rapidjson::value.
CHttpParam & CHttpParam::SetHeaders | ( | const CHttpHeaders & | headers | ) |
Add all HTTP headers to request.
Definition at line 1245 of file ncbi_http_session.cpp.
References CHttpHeaders::Assign(), and CHttpParam::m_Headers.
|
inline |
Set flags passed to CConn_HttpStream.
When sending request, fHTTP_AdjustOnRedirect is always added to the flags.
Definition at line 780 of file ncbi_http_session.hpp.
References flags, and CHttpSession_Base::m_HttpFlags.
Referenced by SFileTrackAPI::GetPath(), SFileTrackAPI::Remove(), and SFileTrackUpload::RenameFile().
void CHttpRequest::SetParam | ( | const CHttpParam & | param | ) |
Set request parameters.
Definition at line 1113 of file ncbi_http_session.cpp.
References CHttpHeaders::eContentType, CHttpParam::GetDeadline(), CHttpParam::GetHeaders(), CHttpParam::GetProxy(), CHttpParam::GetRetries(), CHttpParam::GetRetryProcessing(), CHttpParam::GetTimeout(), CHttpHeaders::GetValue(), CHttpHeaders::HasValue(), CHttpRequest::Headers(), CHttpRequest::m_Deadline, CHttpRequest::m_Proxy, CHttpRequest::m_Retries, CHttpRequest::m_RetryProcessing, CHttpRequest::m_Timeout, CHttpHeaders::Merge(), and CHttpHeaders::SetValue().
Referenced by CHttpRequest::CHttpRequest().
|
inline |
Definition at line 772 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_Protocol.
Referenced by CHttpSessionApp::Run().
|
inline |
Definition at line 234 of file ncbi_http_session.hpp.
References CHttpParam::m_Proxy.
Referenced by CHttpSessionApp::SetupParam().
|
inline |
|
inline |
Definition at line 790 of file ncbi_http_session.hpp.
References CHttpSession_Base::m_Proxy.
CHttpParam & CHttpParam::SetRetries | ( | THttpRetries | retries | ) |
Definition at line 1273 of file ncbi_http_session.cpp.
References CHttpParam::m_Retries.
Referenced by CHttpSessionApp::SetupParam().
|
inline |
Set number of retries.
If not set, the global default value is used ($CONN_MAX_TRY - 1).
Definition at line 593 of file ncbi_http_session.hpp.
References CHttpRequest::m_Retries.
Referenced by g_HttpGet(), g_HttpPost(), g_HttpPut(), CHttpSession_Base::Get(), CHttpSession_Base::Post(), and CHttpSession_Base::Put().
|
inline |
Definition at line 241 of file ncbi_http_session.hpp.
References CHttpParam::m_RetryProcessing.
Referenced by CHttpSessionApp::SetupParam().
CHttpRequest & CHttpRequest::SetRetryProcessing | ( | ESwitch | on_off | ) |
Set whether Execute() should wait for actual response.
Definition at line 1106 of file ncbi_http_session.cpp.
References CHttpRequest::m_RetryProcessing.
Referenced by CGuiHttpSessionRequest::CGuiHttpSessionRequest().
CHttpParam & CHttpParam::SetTimeout | ( | const CTimeout & | timeout | ) |
Definition at line 1266 of file ncbi_http_session.cpp.
References CHttpParam::m_Timeout.
Referenced by CHttpSessionApp::SetupParam().
CHttpRequest & CHttpRequest::SetTimeout | ( | const CTimeout & | timeout | ) |
Set new timeout.
Definition at line 1084 of file ncbi_http_session.cpp.
References CHttpRequest::m_Timeout.
Referenced by g_HttpGet(), g_HttpPost(), g_HttpPut(), CHttpSession_Base::Get(), SFileTrackAPI::GetPath(), CHttpSession_Base::Post(), CHttpSession_Base::Put(), SFileTrackAPI::Remove(), and SFileTrackUpload::RenameFile().
CHttpRequest & CHttpRequest::SetTimeout | ( | unsigned int | sec, |
unsigned int | usec = 0 |
||
) |
Set new timeout in seconds/microseconds.
Definition at line 1091 of file ncbi_http_session.cpp.
References CHttpRequest::m_Timeout, and CTimeout::Set().
void CHttpHeaders::SetValue | ( | CHeaderNameConverter | name, |
CTempString | value | ||
) |
Remove all existing values with the name, set the new value.
Throw exception if the name is a reserved one and can not be set directly (NCBI-SID, NCBI-PHID). These values should be set through CRequestContext, the headers will be added by CConn_HttpStream automatically.
Definition at line 116 of file ncbi_http_session.cpp.
References _VERIFY, map_checker< Container >::clear(), CHttpHeaders::CHeaderNameConverter::GetName(), CHttpHeaders::m_Headers, rapidjson::value, and CHttpHeaders::x_IsReservedHeader().
Referenced by CBiosampleChkApp::CreateBiosampleUpdateWebService(), CCompareWithBiosample::CreateBiosampleUpdateWebService(), g_HttpPost(), g_HttpPut(), SFileTrackAPI::GetPath(), CHttpSession_Base::Post(), CHttpSession_Base::Put(), SFileTrackAPI::Remove(), SFileTrackUpload::RenameFile(), CHttpSessionApp::Run(), CHttpParam::SetHeader(), CHttpRequest::SetParam(), CHttpRequest::x_AddCookieHeader(), and CHttpRequest::x_AdjustHeaders().
|
staticprivate |
Definition at line 1007 of file ncbi_http_session.cpp.
References _ASSERT, CUrl::Adjust(), CUrl::ComposeUrl(), ConnNetInfo_OverrideUserHeader(), ConnNetInfo_ParseURL(), ConnNetInfo_URL(), CUrlArgs::eAmp_Char, CUrl::fArgs_Merge, CUrl::fPath_Append, CUrl::fScheme_Replace, CHttpHeaders::GetHttpHeader(), CHttpResponse::GetStatusCode(), CHttpRequest::m_AdjustUrl, CHttpRequest::m_Headers, SAdjustData::m_IsService, CHttpResponse::m_Location, SAdjustData::m_Request, CHttpRequest::m_Response, CHttpRequest::m_Url, make_c_unique(), NCBI_THROW, CUrl::SetUrl(), and CHttpRequest::x_AddCookieHeader().
Referenced by CHttpRequest::x_InitConnection().
|
staticprivate |
Definition at line 951 of file ncbi_http_session.cpp.
References _ASSERT, eHTTP_HeaderContinue, eHTTP_HeaderError, CConn_HttpStream_Base::GetHTTPHeader(), CConn_HttpStream_Base::GetStatusCode(), CConn_HttpStream_Base::GetStatusText(), SAdjustData::m_Request, CHttpRequest::m_Response, CHttpRequest::m_Stream, s_ParseHttpHeader(), and CHttpResponse::x_Update().
Referenced by CHttpRequest::x_InitConnection().
|
pure virtual |
Write user data to the stream.
Implemented in CTestDataProvider, and CFileDataProvider.
void CHttpFormData::WriteFormData | ( | CNcbiOstream & | out | ) | const |
Write form data to the stream using the selected form content type.
If the data is not valid (e.g. a file does not exist or can not be read), throw CHttpSessionException.
Definition at line 404 of file ncbi_http_session.cpp.
References _ASSERT, CHttpFormData::CreateBoundary(), CUrlArgs::eAmp_Char, CHttpFormData::eFormUrlEncoded, map_checker< Container >::empty(), CUrlArgs::GetQueryString(), HTTP_EOL, ITERATE, CHttpFormData::m_Boundary, CHttpFormData::m_ContentType, CHttpFormData::m_Entries, CHttpFormData::m_Providers, NCBI_THROW, out(), CUrlArgs::SetValue(), and x_WritePartHeader().
Referenced by CHttpRequest::Execute().
Definition at line 938 of file ncbi_http_session.cpp.
References CHttpHeaders::eCookie, CHttpRequest::m_Headers, CHttpRequest::m_Session, CHttpHeaders::SetValue(), and CHttpSession_Base::x_GetCookies().
Referenced by CHttpRequest::sx_Adjust(), and CHttpRequest::x_AdjustHeaders().
|
private |
Definition at line 779 of file ncbi_http_session.cpp.
References CHttpHeaders::eContentType, CHttpFormData::GetContentTypeStr(), CHttpRequest::m_FormData, CHttpRequest::m_Headers, CHttpRequest::m_Url, CHttpHeaders::SetValue(), and CHttpRequest::x_AddCookieHeader().
Referenced by CHttpRequest::x_InitConnection(), and CHttp2Session::x_StartRequest().
|
private |
Definition at line 930 of file ncbi_http_session.cpp.
References eReqMethod_Patch, eReqMethod_Post, eReqMethod_Put, and CHttpRequest::m_Method.
Referenced by CHttpRequest::ContentStream(), and CHttpRequest::FormData().
|
inlineoverrideprivatevirtual |
Implements CHttpSession_Base.
Definition at line 826 of file ncbi_http_session.hpp.
|
privatepure virtual |
Implemented in CHttp2Session, and CHttpSession.
Referenced by CHttpRequest::Execute().
Definition at line 1211 of file ncbi_http_session.cpp.
References CHttpCookie::AsString(), CHttpCookies::begin(), CHttpCookie::eHTTPRequest, and CHttpSession_Base::m_Cookies.
Referenced by CHttpRequest::x_AddCookieHeader().
|
private |
Definition at line 843 of file ncbi_http_session.cpp.
References SSERVICE_Extra::adjust, SSERVICE_Extra::cleanup, CUrl::ComposeUrl(), ConnNetInfo_Create(), ConnNetInfo_Destroy(), ConnNetInfo_OverrideUserHeader(), ConnNetInfo_SetTimeout(), SSERVICE_Extra::data, CUrlArgs::eAmp_Char, CHttpSession_Base::eHTTP_11, NStr::EqualNocase(), eURL_Http, eURL_Https, fHTTP_AdjustOnRedirect, SSERVICE_Extra::flags, fSERV_Http, g_CTimeoutToSTimeout(), CHttpSession_Base::GetHttpFlags(), CHttpHeaders::GetHttpHeader(), CHttpSession_Base::GetProtocol(), CUrl::GetScheme(), CUrl::GetService(), CTimeout::IsDefault(), CNullable< TValue, TNullToValue >::IsNull(), CUrl::IsService(), CHttpRequest::m_Credentials, CHttpHeaders::m_Headers, CHttpRequest::m_Headers, CHttpRequest::m_Method, CHttpRequest::m_Response, CHttpRequest::m_Retries, CHttpRequest::m_Session, CHttpResponse::m_Stream, CHttpRequest::m_Stream, CHttpRequest::m_Timeout, CHttpRequest::m_Url, NCBI_THROW, SSERVICE_Extra::parse_header, CRef< C, Locker >::Reset(), s_Cleanup(), s_ParseHttpHeader(), CHttpRequest::sx_Adjust(), CHttpRequest::sx_ParseHeader(), CHttpRequest::x_AdjustHeaders(), x_RetriesToMaxtry(), and CHttpRequest::x_SetProxy().
Referenced by CHttp2Session::x_StartRequest(), and CHttpSession::x_StartRequest().
|
private |
Definition at line 923 of file ncbi_http_session.cpp.
References CHttpRequest::m_Response, CHttpRequest::m_Session, CHttpRequest::m_Stream, CHttpRequest::m_Url, and CRef< C, Locker >::Reset().
Referenced by CHttp2Session::x_StartRequest().
|
private |
Definition at line 206 of file ncbi_http_session.cpp.
References NStr::CompareNocase(), ERR_POST, i, and kReservedHeaders.
Referenced by CHttpHeaders::AddValue(), and CHttpHeaders::SetValue().
|
private |
Definition at line 1201 of file ncbi_http_session.cpp.
References CHttpCookies::Add(), CHttpCookies::eHeader_SetCookie, ITERATE, and CHttpSession_Base::m_Cookies.
Referenced by CHttpResponse::x_Update().
|
private |
Definition at line 797 of file ncbi_http_session.cpp.
References CONN_HOST_LEN, CONN_PASS_LEN, CONN_USER_LEN, CHttpProxy::GetHost(), CHttpProxy::GetPassword(), CHttpProxy::GetPort(), CHttpRequest::GetProxy(), CHttpSession_Base::GetProxy(), CHttpProxy::GetUser(), SConnNetInfo::http_proxy_host, SConnNetInfo::http_proxy_pass, SConnNetInfo::http_proxy_port, SConnNetInfo::http_proxy_user, CHttpProxy::IsEmpty(), CHttpRequest::m_Session, NCBI_AS_STRING, and NCBI_THROW.
Referenced by CHttpRequest::x_InitConnection().
|
inlineoverrideprivatevirtual |
Implements CHttpSession_Base.
Definition at line 820 of file ncbi_http_session.hpp.
References _ASSERT, CHttpSession_Base::eHTTP_11, and CHttpRequest::x_InitConnection().
|
privatepure virtual |
Implemented in CHttpSession, and CHttp2Session.
Referenced by CHttpRequest::ContentStream(), and CHttpRequest::Execute().
|
private |
Definition at line 510 of file ncbi_http_session.cpp.
References CHttpHeaders::eSetCookie, CHttpHeaders::GetAllValues(), CHttpHeaders::m_Headers, CHttpResponse::m_Headers, CHttpResponse::m_Location, CHttpResponse::m_Session, CHttpResponse::m_StatusCode, CHttpResponse::m_StatusText, map_checker< Container >::swap(), and CHttpSession_Base::x_SetCookies().
Referenced by CHttpRequest::sx_ParseHeader(), and CHttpRequest::x_UpdateResponse().
|
private |
Definition at line 789 of file ncbi_http_session.cpp.
References CHttpRequest::m_Response, and CHttpResponse::x_Update().
Referenced by CHttp2Session::UpdateResponse().
|
inlinevirtual |
Definition at line 640 of file ncbi_http_session.hpp.
|
inlinevirtual |
Definition at line 350 of file ncbi_http_session.hpp.
|
inlinevirtual |
Definition at line 433 of file ncbi_http_session.hpp.
|
inlinevirtual |
Definition at line 148 of file ncbi_http_session.hpp.
|
inlinevirtual |
Definition at line 508 of file ncbi_http_session.hpp.
|
inlinevirtual |
Definition at line 788 of file ncbi_http_session.hpp.
CTlsCertCredentials::~CTlsCertCredentials | ( | void | ) |
Definition at line 533 of file ncbi_http_session.cpp.
References CTlsCertCredentials::m_Cred, and NcbiDeleteTlsCertCredentials().
|
private |
Definition at line 689 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::SetAdjustUrlCallback(), and CHttpRequest::sx_Adjust().
|
mutableprivate |
Definition at line 458 of file ncbi_http_session.hpp.
Referenced by CHttpFormData::Clear(), CHttpFormData::GetContentTypeStr(), and CHttpFormData::WriteFormData().
|
private |
Definition at line 650 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::CAdjustUrlCallback< TCallback >::AdjustUrl().
|
private |
Definition at line 546 of file ncbi_http_session.hpp.
Referenced by CTlsCertCredentials::CTlsCertCredentials(), CTlsCertCredentials::GetCert(), and CTlsCertCredentials::GetNcbiCred().
string CHttpFormData::SFormData::m_ContentType |
Definition at line 447 of file ncbi_http_session.hpp.
Referenced by CHttpFormData::AddEntry().
|
private |
Definition at line 455 of file ncbi_http_session.hpp.
Referenced by CHttpFormData::AddProvider(), CHttpFormData::Clear(), CHttpFormData::GetContentType(), CHttpFormData::GetContentTypeStr(), CHttpFormData::SetContentType(), and CHttpFormData::WriteFormData().
|
private |
Definition at line 807 of file ncbi_http_session.hpp.
Referenced by CHttpSession_Base::Cookies(), CHttpSession_Base::x_GetCookies(), and CHttpSession_Base::x_SetCookies().
Definition at line 548 of file ncbi_http_session.hpp.
Referenced by CTlsCertCredentials::GetNcbiCred(), and CTlsCertCredentials::~CTlsCertCredentials().
|
private |
Definition at line 247 of file ncbi_http_session.hpp.
Referenced by CHttpParam::GetCredentials(), and CHttpParam::SetCredentials().
|
private |
Definition at line 691 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::x_InitConnection(), and CHttp2Session::x_StartRequest().
|
private |
Definition at line 808 of file ncbi_http_session.hpp.
Referenced by CHttpSession_Base::GetCredentials(), and CHttpSession_Base::SetCredentials().
|
private |
Definition at line 249 of file ncbi_http_session.hpp.
Referenced by CHttpParam::GetDeadline(), and CHttpParam::SetDeadline().
|
private |
Definition at line 687 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::Execute(), CHttpRequest::GetDeadline(), CHttpRequest::SetDeadline(), and CHttpRequest::SetParam().
|
private |
Definition at line 456 of file ncbi_http_session.hpp.
Referenced by CHttpFormData::AddEntry(), CHttpFormData::Clear(), CHttpFormData::IsEmpty(), and CHttpFormData::WriteFormData().
|
private |
Definition at line 682 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::Execute(), CHttpRequest::FormData(), and CHttpRequest::x_AdjustHeaders().
|
private |
Definition at line 165 of file ncbi_http_session.hpp.
Referenced by CHttpHeaders::AddValue(), CHttpHeaders::Assign(), CHttpHeaders::Clear(), CHttpHeaders::ClearAll(), CHttpHeaders::CountValues(), CHttpHeaders::Get(), CHttpHeaders::GetAllValues(), CHttpHeaders::GetHttpHeader(), CHttpHeaders::GetValue(), CHttpHeaders::HasValue(), CHttpHeaders::Merge(), CHttpHeaders::ParseHttpHeader(), CHttpHeaders::SetValue(), CHttpRequest::x_InitConnection(), and CHttpResponse::x_Update().
|
private |
Definition at line 244 of file ncbi_http_session.hpp.
Referenced by CHttpParam::AddHeader(), CHttpParam::GetHeaders(), CHttpParam::SetHeader(), and CHttpParam::SetHeaders().
|
private |
Definition at line 522 of file ncbi_http_session.hpp.
Referenced by CHttpResponse::Headers(), and CHttpResponse::x_Update().
|
private |
Definition at line 681 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::Execute(), CHttpRequest::Headers(), CHttpRequest::sx_Adjust(), CHttpRequest::x_AddCookieHeader(), CHttpRequest::x_AdjustHeaders(), CHttpRequest::x_InitConnection(), and CHttp2Session::x_StartRequest().
|
private |
Definition at line 200 of file ncbi_http_session.hpp.
Referenced by CHttpProxy::GetHost(), and CHttpProxy::IsEmpty().
|
private |
Definition at line 806 of file ncbi_http_session.hpp.
Referenced by CHttpSession_Base::GetHttpFlags(), and CHttpSession_Base::SetHttpFlags().
|
private |
Definition at line 520 of file ncbi_http_session.hpp.
Referenced by CHttpResponse::GetLocation(), CHttpRequest::sx_Adjust(), and CHttpResponse::x_Update().
|
private |
Definition at line 680 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::Execute(), CHttpRequest::x_CanSendData(), CHttpRequest::x_InitConnection(), and CHttp2Session::x_StartRequest().
|
private |
Definition at line 96 of file ncbi_http_session.hpp.
Referenced by CHttpHeaders::CHeaderNameConverter::GetName().
|
private |
Definition at line 203 of file ncbi_http_session.hpp.
Referenced by CHttpProxy::GetPassword().
|
private |
Definition at line 547 of file ncbi_http_session.hpp.
Referenced by CTlsCertCredentials::CTlsCertCredentials(), CTlsCertCredentials::GetNcbiCred(), and CTlsCertCredentials::GetPKey().
|
private |
Definition at line 201 of file ncbi_http_session.hpp.
Referenced by CHttpProxy::GetPort().
|
private |
Definition at line 805 of file ncbi_http_session.hpp.
Referenced by CHttpSession_Base::GetProtocol(), and CHttpSession_Base::SetProtocol().
|
private |
Definition at line 457 of file ncbi_http_session.hpp.
Referenced by CHttpFormData::AddProvider(), CHttpFormData::Clear(), CHttpFormData::IsEmpty(), CHttpFormData::SetContentType(), and CHttpFormData::WriteFormData().
|
private |
Definition at line 248 of file ncbi_http_session.hpp.
Referenced by CHttpParam::GetProxy(), and CHttpParam::SetProxy().
|
private |
Definition at line 692 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::GetProxy(), CHttpRequest::SetParam(), and CHttpRequest::SetProxy().
|
private |
Definition at line 809 of file ncbi_http_session.hpp.
Referenced by CHttpSession_Base::GetProxy(), and CHttpSession_Base::SetProxy().
|
private |
Definition at line 684 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::ContentStream(), CHttpRequest::Execute(), CHttpRequest::sx_Adjust(), CHttpRequest::sx_ParseHeader(), CHttpRequest::x_InitConnection(), CHttpRequest::x_InitConnection2(), and CHttpRequest::x_UpdateResponse().
|
private |
Definition at line 246 of file ncbi_http_session.hpp.
Referenced by CHttpParam::GetRetries(), and CHttpParam::SetRetries().
|
private |
Definition at line 686 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::GetRetries(), CHttpRequest::SetParam(), CHttpRequest::SetRetries(), and CHttpRequest::x_InitConnection().
|
private |
Definition at line 250 of file ncbi_http_session.hpp.
Referenced by CHttpParam::GetRetryProcessing(), and CHttpParam::SetRetryProcessing().
|
private |
Definition at line 688 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::Execute(), CHttpRequest::GetRetryProcessing(), CHttpRequest::SetParam(), and CHttpRequest::SetRetryProcessing().
|
private |
Definition at line 518 of file ncbi_http_session.hpp.
Referenced by CHttpResponse::x_Update().
|
private |
Definition at line 678 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::ContentStream(), CHttpRequest::Execute(), CHttpRequest::x_AddCookieHeader(), CHttpRequest::x_InitConnection(), CHttpRequest::x_InitConnection2(), and CHttpRequest::x_SetProxy().
|
private |
Definition at line 523 of file ncbi_http_session.hpp.
Referenced by CHttpResponse::CanGetContentStream(), CHttpResponse::ContentStream(), CHttpResponse::ErrorStream(), CHttpResponse::GetStatusCode(), and CHttpResponse::x_Update().
|
private |
Definition at line 524 of file ncbi_http_session.hpp.
Referenced by CHttpResponse::ContentStream(), CHttpResponse::ErrorStream(), CHttpResponse::GetStatusText(), and CHttpResponse::x_Update().
|
private |
Definition at line 521 of file ncbi_http_session.hpp.
Referenced by CHttpResponse::ContentStream(), CHttpResponse::ErrorStream(), and CHttpRequest::x_InitConnection().
|
private |
Definition at line 683 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::ContentStream(), CHttpRequest::Execute(), CHttpRequest::FormData(), CHttpRequest::sx_ParseHeader(), CHttpRequest::x_InitConnection(), and CHttpRequest::x_InitConnection2().
|
private |
Definition at line 245 of file ncbi_http_session.hpp.
Referenced by CHttpParam::GetTimeout(), and CHttpParam::SetTimeout().
|
private |
Definition at line 685 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::GetTimeout(), CHttpRequest::SetParam(), CHttpRequest::SetTimeout(), and CHttpRequest::x_InitConnection().
|
private |
Definition at line 519 of file ncbi_http_session.hpp.
|
private |
Definition at line 679 of file ncbi_http_session.hpp.
Referenced by CHttpRequest::Execute(), CHttpRequest::sx_Adjust(), CHttpRequest::x_AdjustHeaders(), CHttpRequest::x_InitConnection(), CHttpRequest::x_InitConnection2(), and CHttp2Session::x_StartRequest().
|
private |
Definition at line 202 of file ncbi_http_session.hpp.
Referenced by CHttpProxy::GetUser().
string CHttpFormData::SFormData::m_Value |
Definition at line 446 of file ncbi_http_session.hpp.
Referenced by CHttpFormData::AddEntry().
|
friend |
Definition at line 634 of file ncbi_http_session.hpp.
|
friend |
Definition at line 151 of file ncbi_http_session.hpp.
|
friend |
Definition at line 436 of file ncbi_http_session.hpp.
|
friend |
Definition at line 511 of file ncbi_http_session.hpp.
|
friend |
Definition at line 793 of file ncbi_http_session.hpp.
Referenced by CHttpSession_Base::NewRequest().
|
friend |
Definition at line 152 of file ncbi_http_session.hpp.
|
friend |
Definition at line 794 of file ncbi_http_session.hpp.
|
friend |
Definition at line 633 of file ncbi_http_session.hpp.
|
friend |
Definition at line 632 of file ncbi_http_session.hpp.