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

    getHTTPHeader( "Content-Type", contentType );

    setSimpleContent( contentType, contentPtr, contentLength ); 
}
예제 #2
0
파일: HTTPRequest.cpp 프로젝트: dbxmm/http
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;
}