aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-05-19 13:43:03 +0200
committerStefan Boberg <[email protected]>2021-05-19 13:43:03 +0200
commitf42181040fe45b5ac9a9b1daf84b2e269dce105b (patch)
treee8fa8be296c7f56faea5ec1af2471239f64c5da4 /zencore/include
parentAdded HashStringDjb2() (diff)
downloadzen-f42181040fe45b5ac9a9b1daf84b2e269dce105b.tar.xz
zen-f42181040fe45b5ac9a9b1daf84b2e269dce105b.zip
Added HttpServerRequest::RequestContentType()
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/httpserver.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/zencore/include/zencore/httpserver.h b/zencore/include/zencore/httpserver.h
index d07eba339..8f762c2e4 100644
--- a/zencore/include/zencore/httpserver.h
+++ b/zencore/include/zencore/httpserver.h
@@ -167,7 +167,8 @@ enum class HttpContentType
kText,
kJSON,
kCbObject,
- kCbPackage
+ kCbPackage,
+ kUnknownContentType
};
/** HTTP Server Request
@@ -209,7 +210,8 @@ public:
QueryParams GetQueryParams();
- inline HttpVerb RequestVerb() const { return m_Verb; }
+ inline HttpVerb RequestVerb() const { return m_Verb; }
+ inline HttpContentType RequestContentType() { return m_ContentType; }
const char* HeaderAccept() const;
const char* HeaderAcceptEncoding() const;
@@ -248,6 +250,7 @@ protected:
bool m_SuppressBody = false;
HttpVerb m_Verb = HttpVerb::kGet;
uint64_t m_ContentLength = ~0ull;
+ HttpContentType m_ContentType = HttpContentType::kBinary;
ExtendableStringBuilder<256> m_Uri;
ExtendableStringBuilder<256> m_QueryString;
};
@@ -263,9 +266,9 @@ private:
/**
* Base class for implementing an HTTP "service"
- *
+ *
* A service exposes one or more endpoints with a certain URI prefix
- *
+ *
*/
class HttpService
@@ -340,10 +343,10 @@ HttpRouterRequest::GetCapture(int Index) const
//////////////////////////////////////////////////////////////////////////
/** HTTP request router helper
- *
+ *
* This helper class allows a service implementer to register one or more
* endpoints using pattern matching (currently using regex matching)
- *
+ *
*/
class HttpRequestRouter