-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathHttpService.cpp
More file actions
48 lines (36 loc) · 1.23 KB
/
HttpService.cpp
File metadata and controls
48 lines (36 loc) · 1.23 KB
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
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include "HttpService.h"
#include "ClientError.h"
using namespace std;
HttpService::HttpService(string pathPrefix) {
this->m_pathPrefix = pathPrefix;
}
string HttpService::pathPrefix() {
return m_pathPrefix;
}
void HttpService::head(HTTPRequest *request, HTTPResponse *response) {
cout << "HEAD " << request->getPath() << endl;
throw ClientError::methodNotAllowed();
}
void HttpService::get(HTTPRequest *request, HTTPResponse *response) {
cout << "GET " << request->getPath() << endl;
throw ClientError::methodNotAllowed();
}
void HttpService::put(HTTPRequest *request, HTTPResponse *response) {
cout << "PUT " << request->getPath() << endl;
throw ClientError::methodNotAllowed();
}
void HttpService::post(HTTPRequest *request, HTTPResponse *response) {
cout << "POST " << request->getPath() << endl;
throw ClientError::methodNotAllowed();
}
void HttpService::del(HTTPRequest *request, HTTPResponse *response) {
cout << "DELETE " << request->getPath() << endl;
throw ClientError::methodNotAllowed();
}
void HttpService::move(HTTPRequest *request, HTTPResponse *response) {
cout << "MOVE " << request->getPath() << endl;
throw ClientError::methodNotAllowed();
}