当前位置: 首页>>代码示例>>C++>>正文


C++ request::method方法代码示例

本文整理汇总了C++中request::method方法的典型用法代码示例。如果您正苦于以下问题:C++ request::method方法的具体用法?C++ request::method怎么用?C++ request::method使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在request的用法示例。


在下文中一共展示了request::method方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: exceptionf

fetcher_handler::fetcher_handler(const request &req, handler *h)
  : _handler(h)
{
    _recv_mb = new ACE_Message_Block(_max_response_size);

    // Create the message to send
    ACE_Message_Block *hdr_mb = new ACE_Message_Block(_max_header_size);
    
    // GET file HTTP/1.1
    // Connection: close
    //
    int n;
    n = ACE_OS::snprintf(hdr_mb->wr_ptr(), hdr_mb->space(), 
                         "%s %s HTTP/1.0\r\n",
                         req.method().c_str(), 
                         req.target_url().file().c_str());
    if (n > 0) hdr_mb->wr_ptr(n);
    n = ACE_OS::snprintf(hdr_mb->wr_ptr(), hdr_mb->space(), 
                         "Host: %s\r\n" \
                         "Connection: close\r\n\r\n",
                         req.target_url().host().c_str());
                         
    if (n > 0) hdr_mb->wr_ptr(n);
    if (hdr_mb->space()) {
        *(hdr_mb->wr_ptr()) = 0;
        ACE_DEBUG((LM_DEBUG, "Writing HTTP request\n",
                   hdr_mb->base()));
        // ACE_DEBUG((LM_DEBUG, "Writing HTTP request:\n%s",
        //           hdr_mb->base()));
    } else {
        throw exceptionf(0, "Not enough space in buffer of size %d for HTTP header",
                         _max_header_size);
    }
    
    this->putq(hdr_mb); 
}
开发者ID:ajalkane,项目名称:rvhouse,代码行数:36,代码来源:fetcher_handler.cpp

示例2: execute

std::future<response> client::options(request req, request_options options) {
  req.method(method::options);
  return execute(req, options);
}
开发者ID:AJLeuer,项目名称:cpp-netlib,代码行数:4,代码来源:client.cpp


注:本文中的request::method方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。