dhgdh
Dependencies: MAX44000 PWM_Tone_Library nexpaq_mdk
Fork of LED_Demo by
Diff: mbd_os/libraries/net/https/HTTPHeader.cpp
- Revision:
- 1:55a6170b404f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbd_os/libraries/net/https/HTTPHeader.cpp Sat Sep 17 16:32:05 2016 +0000 @@ -0,0 +1,24 @@ +#include "HTTPHeader.h" +#include <stdlib.h> +using std::map; +using std::string; + +HTTPHeader::HTTPHeader(): +_status(HTTP_ERROR), +_fields() +{ +} + +std::string HTTPHeader::getField(const std::string& name) +{ + map<string,string>::iterator itor = _fields.find(name); + if(itor == _fields.end()) + return string(); + return itor->second; +} + +int HTTPHeader::getBodyLength() +{ + return atoi(getField("Content-Length").c_str()); +} +