-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttpresponse.h
More file actions
39 lines (33 loc) · 807 Bytes
/
httpresponse.h
File metadata and controls
39 lines (33 loc) · 807 Bytes
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
#ifndef HTTPRESPONSE_H
#define HTTPRESPONSE_H 1
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include "mysocket.h"
#include "myutill.h"
using namespace std;
class HttpResponse{
int datalen;
map<string, string> headers;
string version;
int status;
string reason;
bool headflag; //写data之前数据有没有写?
MySocket* skfd;
static map<string, string> mime_init();
public:
static map<string,string> MIME_TYPE;
int addHeader(string , string );
int setHeader(string , string );
int setStatus(int);
int setVersion(string);
int setDataLen(long);
int writeData(char*,int);
int writeData(string &);
int writeHeader();
int finish();
HttpResponse(MySocket * arg_skfd);
~HttpResponse();
};
#endif