This is solved. I found out my issue-- I was setting the Content-Length for a POST but not setting the body for the request. For reference here are the updated lines:
if (HTTPBody.length() > 0)
{
std::string val;
formatString(val, "%zd",HTTPBody.length());
req.headers().add(header_names::content_length,val);
if (contentType.length() > 0)
req.set_body(HTTPBody,contentType);
else
req.set_body(HTTPBody);
}