Added PUT support

This commit is contained in:
Fred Nicolson
2017-06-16 17:06:34 +01:00
parent aa8509e460
commit 50c62f2c4a
2 changed files with 7 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ namespace fr
Unknown = 0,
Get = 1,
Post = 2,
Put = 3,
RequestTypeCount = 3,
};
enum RequestStatus

View File

@@ -149,8 +149,13 @@ namespace fr
//Check what it is
if(str.compare(0, type_end, "GET") == 0)
request_type = fr::Http::Get;
else
else if(str.compare(0, type_end, "POST") == 0)
request_type = fr::Http::Post;
else if(str.compare(0, type_end, "PUT") == 0)
request_type = fr::Http::Put;
else
request_type = fr::Http::Unknown;
return;
}
throw std::invalid_argument("No known request type found in: " + str);