Files
ylib/include/net/http_request.h
xx ef63cfd6aa 1、删除部分三方库
2、整合ylib为一个lib库
2024-05-26 12:51:32 +08:00

80 lines
3.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include "http_define.h"
#if USE_NET_HTTP_WEBSITE
#include <string>
#include <vector>
#include "http_session.h"
#include "http_parser.h"
#include "http_interface.h"
namespace ylib
{
namespace network
{
namespace http
{
class reqpack;
class server;
/********************************************************************
* classHttp请求解析类
********************************************************************/
class request :public network::http::interface_
{
public:
request();
~request();
/***************************************************************************
* function取协议头
* param
* name 名称
* value 内容
***************************************************************************/
bool header(const std::string& name, std::string& value);
/***************************************************************************
* function取请求类型
***************************************************************************/
network::http::method method();
/***************************************************************************
* function取请求路径
***************************************************************************/
std::string filepath();
/***************************************************************************
* function取请求主机
***************************************************************************/
std::string host();
/***************************************************************************
* function取Session
***************************************************************************/
network::http::session& session(const std::string& session_id);
/// <summary>
/// 取TOKEN
/// </summary>
/// <returns></returns>
std::string token();
/***************************************************************************
* function取reqpack
***************************************************************************/
network::http::reqpack* reqpack();
/***************************************************************************
* function解析器
***************************************************************************/
network::http::parser* parser();
/***************************************************************************
* functionGet Browserr Remote Ipaddress
***************************************************************************/
std::string remote_ipaddress(bool find_header = false, const std::string& inside_ipaddress = "");
ushort remote_port();
friend class reqpack;
private:
network::http::reqpack* m_reqpack;
network::http::session m_session;
network::http::parser m_parser;
};
}
}
}
#endif