To be able to store data in my LMDB Service, I need to store data as base64 items. To do that, I need to transmit json data from the client to the server. It can’t be passed on the url. So I use post handling. Here is the C++ handler:
void TheServer::handle_post(http_request message)
std::wstring request = ServerHelper::FindParameter(message, _T("request"));
if (request == Constants::VerbSetDataB64)
elseif (request == Constants::VerbGetDataB64)
// Does not work yet
// an internal problem occured
The C++ routine here to analyze is RequestVerbSetData64. Here is the code:
The source code is simple to write, simple to read. Because it is native code, it is fast and we just need to distribute the dll we use. here, it’s just the C runtime, the C++ runtime and the CPPREST dll. This is the advantage of the native stuff, you don’t need to distribute any framework that size is around 350 MB… It’s lightweight, it’s fast, it’s built on the metal.
- Aide-Mémoire C++ (July 2020) - Dunod
- Aide-Mémoire C#/NET (Jan 2021) - Dunod
- Pro C++ Performance & Optimization (working) - Apress
Technical writer for french magazine Programmez since 2011.
If you are interested in more infomations about C++, Win32, MFC, WRL and Modern Apps, .NET, C#, WCF, SQL Server, IIS and Windows Server, Azure and Docker, Kubernetes, just look at my site : windowscpp.com
Email me at firstname.lastname@example.org
Opinions are mine and not those of my company or Microsoft or any Gold Partners in the Microsoft ecosystem.