Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: features/unsupported/net/https/HTTPHeader.cpp
- Revision:
- 0:f269e3021894
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/features/unsupported/net/https/HTTPHeader.cpp Sun Oct 23 15:10:02 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());
+}
+