FFL_HttpRequest.hpp 1.1 KB
Newer Older
L
libb 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
/*
*  This file is part of FFL project.
*
*  The MIT License (MIT)
*  Copyright (C) 2017-2018 zhufeifei All rights reserved.
*
*  FFL_HttpRequest.hpp   
*  Created by zhufeifei(34008081@qq.com) on 2018/07/15
*  https://github.com/zhenfei2016/FFL-v2.git
*
*  http请求
*/
#ifndef _FFL_HTTP_REQUEST_HPP_
#define _FFL_HTTP_REQUEST_HPP_

#include <FFL_Core.h>
#include <FFL_Ref.hpp>
#include <net/http/FFL_HttpTransportBase.hpp>
#include <net/FFL_NetStream.hpp>

namespace FFL {
	class HttpResponse;

	enum  HTTP_Method {
		GET = 0,
		POST = 1,
	};

	class FFLIB_API_IMPORT_EXPORT HttpRequest : public HttpTransportBase {
	public:
		friend class HttpClient;
		friend class HttpParserImpl;
		
		HttpRequest();
		HttpRequest(FFL::sp<HttpClient> client);
	public:
		virtual ~HttpRequest();	
		FFL::sp<HttpResponse> makeResponse();
	public:
		//
		//  获取设置method
		//
		void setMethod(HTTP_Method med);
		HTTP_Method getMethod();
		//
		//  请求内容
		//  header :头内容		
		//  content:内容
		//
		virtual bool writeHeader();
	protected:
		HTTP_Method mMethod;
	};
}

#endif