& script_name)
55m_ScriptName(script_name),
89 #define BASE_URL_REFRESH_FREQ 100 107 static const charkEutils[] =
"eutils.ncbi.nlm.nih.gov";
108 static const charkEutilsLB[] =
"eutils_lb";
122 stringscheme(
"http");
126 buf,
sizeof(
buf), kEutils);
127host =
string(web && *web ? web : kEutils);
139TEUtilsBaseURLParam::SetDefault(url);
172 "Content-Type: application/x-www-form-urlencoded",
189 if(
value.empty() ) {
214 if( !webenv.empty() ) {
215 if( !args.empty() ) {
223 if( !args.empty() ) {
226args +=
"query_key="+ qk;
229 if( !tool.empty() ) {
230 if( !args.empty() ) {
237 if( !email.empty() ) {
238 if( !args.empty() ) {
245 if( !args.empty() ) {
248args += it->first +
'='+
300 if(
ctx.GetSendQueryKey())
return ctx.GetQueryKey();
350 if(ids.find(
"id=") == 0) {
364 if( !ret.empty() ) {
367ret += it->AsQueryString();
Helper hook-up class that installs default logging/registry/locking (but only if they have not yet be...
This stream exchanges data with an HTTP server located at the URL: http[s]://host[:port]/path[?...
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator end() const
const_iterator find(const key_type &key) const
NCBI_PARAM_DEF_EX(string, EUtils, Base_URL, "", eParam_NoThread, EUTILS_BASE_URL)
#define BASE_URL_REFRESH_FREQ
typedef NCBI_PARAM_TYPE(EUtils, Base_URL) TEUtilsBaseURLParam
static string s_CachedBaseUrl
static int s_BaseUrlRefreshCount
static const string kDefaultEUtils_Path
DEFINE_STATIC_MUTEX(s_BaseUrlMutex)
NCBI_PARAM_DECL(string, EUtils, Base_URL)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ fHTTP_AutoReconnect
See HTTP_CreateConnectorEx()
string AsQueryString(void) const
Return a formatted list of groups ('id=12,34&id=56,78').
void SetDatabase(const string &database)
Setting new database disconnects the request.
CObjectIStream * GetObjectIStream(void)
Get serial stream for reading xml or asn data.
unique_ptr< CConn_HttpStream > m_Stream
const string & GetEmail(void) const
Optional contact e-mail.
void ResetQueryKey(void)
Reset requests's query_key, use the one from the connectiono context.
virtual string GetQueryString(void) const
Get CGI script query string.
unique_ptr< CObjectIStream > m_ObjStream
void SetConnContext(const CRef< CEUtils_ConnContext > &ctx)
Set new request context.
CRef< CEUtils_ConnContext > & GetConnContext(void) const
Get current request context.
CNcbiIostream & GetStream(void)
Get input stream for reading plain data.
CEUtils_ConnContext(void)
void SetQueryKey(const string &key)
Override query_key stored in the connection context.
void SetGroups(const string &groups)
Parse a set of id groups from a single string ('id=12,34&id=56,78').
const string & GetScriptName(void) const
Get CGI script name (e.g. efetch.fcgi).
void SetArgument(const string &name, const string &value)
Add/change custom argument. Remove the argument if the value is empty.
static const string & GetBaseURL(void)
Get base url for all e-utils requests.
virtual ESerialDataFormat GetSerialDataFormat(void) const
Get serial stream format for reading data.
CRef< CEUtils_ConnContext > m_Context
void AddId(const string &id)
Add a single id to the list.
const string & GetTool(void) const
A string with no internal spaces that identifies the resource which is using Entrez links (optional).
static void ResetBaseURL(void)
Reset cached base url so that it's refreshed on next request.
void Read(string *content)
Read the whole stream into the string.
CObjectIStream * GetObjIStream(void)
Get serial stream for reading xml or asn data.
CEUtils_Request(CRef< CEUtils_ConnContext > &ctx, const string &script_name)
Create request.
void Connect(void)
Open connection, create the stream.
const string & GetWebEnv(void) const
Get WebEnv.
vector< CEUtils_IdGroup > TIdGroupSet
const string & GetArgument(const string &name) const
Get argument by name.
const string & GetQueryKey(void) const
Read query_key value from the request or from the connection context.
static void SetBaseURL(const string &url)
Set new base url for all e-utils requests.
void Disconnect(void)
Close connection, destroy the stream.
void SetIds(const string &ids)
Parse all ids from a string (e.g. 'id=123,456,78').
virtual string GetURL(void) const
Return base url + script name. Does not include query string.
string AsQueryString(void) const
Get a formatted list of ids (e.g. 'id=123,456,78').
@ eHttp_Post
Use POST (default)
ESerialDataFormat
Data file format.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
void Reset(void)
Reset reference object.
@ eParam_NoThread
Do not use per-thread values.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
SSERV_Info * SERV_GetInfo(const char *service, TSERV_Type types, unsigned int preferred_host, const SConnNetInfo *net_info)
Same as "SERV_GetInfoEx(., ., ., ., 0, 0, 0)" â i.e.
static string ntoa(const CNCBI_IPAddr &addr)
BSD-like API.
IO_PREFIX::iostream CNcbiIostream
Portable alias for iostream.
size_t NcbiStreamToString(string *s, CNcbiIstream &is, size_t pos=0)
Input the entire contents of an istream into a string (NULL causes drain).
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
@ eUrlEnc_ProcessMarkChars
Convert all non-alphanumeric chars, spaces are converted to '+'.
const STimeout * g_CTimeoutToSTimeout(const CTimeout &cto, STimeout &sto)
CTimeout/STimeout adapters.
const char * ConnNetInfo_GetValue(const char *service, const char *param, char *value, size_t value_size, const char *def_value)
SConnNetInfo * ConnNetInfo_Create(const char *service)
void ConnNetInfo_Destroy(SConnNetInfo *net_info)
use only n Cassandra database for the lookups</td > n</tr > n< tr > n< td > yes</td > n< td > do not use tables BIOSEQ_INFO and BLOB_PROP in the Cassandra database
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
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