本文整理汇总了C++中llhttpnode::ResponsePtr::result方法的典型用法代码示例。如果您正苦于以下问题:C++ ResponsePtr::result方法的具体用法?C++ ResponsePtr::result怎么用?C++ ResponsePtr::result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llhttpnode::ResponsePtr
的用法示例。
在下文中一共展示了ResponsePtr::result方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get
virtual void get(
LLHTTPNode::ResponsePtr response,
const LLSD& context) const
{
std::string name = context["request"]["wildcard"]["option-name"];
response->result(LLApp::instance()->getOption(name));
}
示例2: makeRequest
std::string makeRequest(
const std::string& name,
const std::string& httpRequest,
bool timeout = false)
{
LLPipeStringInjector* injector = new LLPipeStringInjector(httpRequest);
LLPipeStringExtractor* extractor = new LLPipeStringExtractor();
apr_pool_t* pool;
apr_pool_create(&pool, NULL);
LLPumpIO* pump;
pump = new LLPumpIO(pool);
LLPumpIO::chain_t chain;
LLSD context;
chain.push_back(LLIOPipe::ptr_t(injector));
LLIOHTTPServer::createPipe(chain, mRoot, LLSD());
chain.push_back(LLIOPipe::ptr_t(extractor));
pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS);
pumpPipe(pump, 10);
if(mResponse.notNull() && (! timeout))
{
mResponse->result(mResult);
mResponse = NULL;
}
pumpPipe(pump, 10);
std::string httpResult = extractor->string();
chain.clear();
delete pump;
apr_pool_destroy(pool);
if(mResponse.notNull() && timeout)
{
mResponse->result(mResult);
mResponse = NULL;
}
return httpResult;
}
示例3: post
// virtual
void LLHTTPNode::post(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const
{
try
{
response->result(simplePost(input));
}
catch (NotImplemented)
{
response->methodNotAllowed();
}
}
示例4: get
// virtual
void LLHTTPNode::get(LLHTTPNode::ResponsePtr response, const LLSD& context) const
{
try
{
response->result(simpleGet());
}
catch (NotImplemented)
{
response->methodNotAllowed();
}
}
示例5: post
virtual void post(
LLHTTPNode::ResponsePtr response,
const LLSD& context,
const LLSD& input) const
{
LLSD result = LLApp::instance()->getOptionData(
LLApp::PRIORITY_RUNTIME_OVERRIDE);
LLSD::map_const_iterator iter = input.beginMap();
LLSD::map_const_iterator end = input.endMap();
for(; iter != end; ++iter)
{
result[(*iter).first] = (*iter).second;
}
LLApp::instance()->setOptionData(
LLApp::PRIORITY_RUNTIME_OVERRIDE,
result);
response->result(result);
}