⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpcontext.cpp

📁 linux下简单对象应用协议的开发库
💻 CPP
字号:
/** Implementation of the HttpContext class
  * @file HttpContext.cpp
  * @author Christian Aberger 
  * Copyright (C) 2001 WebWare (http://www.webware.at) 
  */ 
#include "HttpContext.h"

HttpMessage::HttpMessage() {
}
HttpRequest::HttpRequest() 
: _method(GET)
, _body(NULL)
, _contentlength(0)
{
}
HttpRequest::~HttpRequest() {
    delete _body;
}
const char *HttpRequest::getQueryString() {
    return _querystring.c_str();
}
const char *HttpRequest::getBody() {
    static const char szEmpty[] = "";
    return NULL == _body ? szEmpty : _body;
}
void *HttpRequest::getData() {
    return _body;
}
HttpRequest::Method HttpRequest::getMethod() const {
    return _method;
}
unsigned long HttpRequest::getContentLength() const {
    return _contentlength;
}
bool HttpRequest::operator<<(std::istream& is) {
    delete _body, _body = NULL;
    bool bRet = true;
    if (0 != _contentlength) {
        _body = new char[_contentlength + 1];
        memset(_body, 0, _contentlength + 1);
        is.read(_body, _contentlength);
        bRet = is.good();
    } else {
        bRet = false;
    }
    return bRet;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -