fork of HTTPClient, adding custom content type for HTTPText (for now)

Fork of HTTPClient by wolf SSL

Revision:
34:09abfb894400
Parent:
16:1f743885e7de
diff -r 77082c88748a -r 09abfb894400 data/HTTPText.cpp
--- a/data/HTTPText.cpp	Tue Jul 21 01:07:25 2015 +0000
+++ b/data/HTTPText.cpp	Mon Sep 28 08:54:27 2015 +0000
@@ -36,7 +36,7 @@
 
 HTTPText::HTTPText(char* str, size_t size) : m_str(str), m_size(size), m_pos(0)
 {
-
+    m_datatype = "text/plain";
 }
 
 //IHTTPDataIn
@@ -55,7 +55,7 @@
 
 /*virtual*/ int HTTPText::getDataType(char* type, size_t maxTypeLen) //Internet media type for Content-Type header
 {
-  strncpy(type, "text/plain", maxTypeLen-1);
+  strncpy(type, m_datatype.c_str(), maxTypeLen-1);
   type[maxTypeLen-1] = '\0';
   return OK;
 }
@@ -85,9 +85,9 @@
   return OK;
 }
 
-/*virtual*/ void HTTPText::setDataType(const char* type) //Internet media type from Content-Type header
+void HTTPText::setDataType(const char* type) //Internet media type from Content-Type header
 {
-
+    m_datatype = type;
 }
 
 /*virtual*/ void HTTPText::setIsChunked(bool chunked) //From Transfer-Encoding header
@@ -99,6 +99,3 @@
 {
 
 }
-
-
-