void 
RESTRepresentation::setSimpleContent( unsigned char *contentPtr, unsigned long contentLength )
{
    std::string contentType;

    getHTTPHeader( "Content-Type", contentType );

    setSimpleContent( contentType, contentPtr, contentLength ); 
}
Esempio n. 2
0
int HTTPRequest::copyToFile(ofstream& ofs)
{
	size_t contentLength = atoi(getHTTPHeader("Content-Length").c_str());

	if (ofs.good())
	{
		ofs.write(m_requestBody.c_str(), contentLength);
	}

	if (ofs.bad())
		return -1;

	return 0;
}