本文整理汇总了C++中HTTPServerRequest::getParam方法的典型用法代码示例。如果您正苦于以下问题:C++ HTTPServerRequest::getParam方法的具体用法?C++ HTTPServerRequest::getParam怎么用?C++ HTTPServerRequest::getParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPServerRequest
的用法示例。
在下文中一共展示了HTTPServerRequest::getParam方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scriptDetails
void HTTPServerRequestDespatcher::scriptDetails(HTTPServerRequest &request, std::string &response)
{
long testID = atoi(request.getParam("test_id").c_str());
long runID = atoi(request.getParam("run_id").c_str());
std::string filePath = m_webContentPath + "script_details.tplt";
std::string dataContent;
getScriptScheduledTestResultsDetails(m_pMonitoringDB, testID, runID, dataContent);
HTTPServerTemplateFileResponse resp(filePath, dataContent);
response = resp.responseString();
}
示例2: singleComponents
void HTTPServerRequestDespatcher::singleComponents(HTTPServerRequest &request, std::string &response)
{
long runID = atoi(request.getParam("run_id").c_str());
long testID = atoi(request.getParam("test_id").c_str());
std::string filePath = m_webContentPath + "single_components.tplt";
std::string dataContent;
getSingleScheduledTestComponentsList(m_pMonitoringDB, testID, runID, dataContent);
HTTPServerTemplateFileResponse resp(filePath, dataContent);
response = resp.responseString();
}
示例3: editScriptPage
void HTTPServerRequestDespatcher::editScriptPage(HTTPServerRequest &request, std::string &response)
{
if (request.isPost()) // actual submission
{
std::string thisResponse;
if (editScriptScheduledTestPage(m_pMonitoringDB, request, thisResponse))
{
// okay
HTTPServerRedirectResponse resp("/monitoring");
response = resp.responseString();
}
else
{
HTTPServerResponse resp(500, thisResponse);
response = resp.responseString();
}
}
else // otherwise, serve up the edit form
{
std::string templatePath = m_webContentPath + "form.tplt";
std::string title = "Edit Script Page";
std::string formContent;
long testID = atoi(request.getParam("page_id").c_str());
generateEditScriptScheduledTestPageForm(m_pMonitoringDB, testID, formContent);
HTTPServerTemplateFileResponse resp(templatePath, title, formContent);
response = resp.responseString();
}
}
示例4: singleDetails
void HTTPServerRequestDespatcher::singleDetails(HTTPServerRequest &request, std::string &response)
{
long runID = atoi(request.getParam("runid").c_str());
std::string filePath = m_webContentPath + "single_details.tplt";
std::string dataContent;
formatDBSingleTestResponseToHTMLDL(m_pMonitoringDB, runID, dataContent);
HTTPServerTemplateFileResponse resp(filePath, dataContent);
response = resp.responseString();
}
示例5: viewScriptTest
void HTTPServerRequestDespatcher::viewScriptTest(HTTPServerRequest &request, std::string &response)
{
std::string filePath = m_webContentPath + "view_script_test.tplt";
long testID = 0;
std::string strTestID = request.getParam("testid");
if (!strTestID.empty())
testID = atoi(strTestID.c_str());
std::string description;
std::string dataContent;
getScriptScheduledTestResultsList(m_pMonitoringDB, testID, description, dataContent);
HTTPServerTemplateFileResponse resp(filePath, description, dataContent);
response = resp.responseString();
}
示例6: history
void HTTPServerRequestDespatcher::history(HTTPServerRequest &request, std::string &response)
{
int offset = 0;
if (request.hasParams())
{
offset = atoi(request.getParam("start").c_str());
}
std::string filePath = m_webContentPath + "history.tplt";
std::string dataContent;
getSingleTestHistoryList(m_pMonitoringDB, dataContent, offset);
HTTPServerTemplateFileResponse resp(filePath, dataContent);
response = resp.responseString();
}
示例7: deleteScriptTest
void HTTPServerRequestDespatcher::deleteScriptTest(HTTPServerRequest &request, std::string &response)
{
unsigned long testID = atoi(request.getParam("test_id").c_str());
std::string output;
if (deleteScriptTestFromDB(m_pMonitoringDB, testID, output))
{
HTTPServerRedirectResponse resp("/monitoring");
response = resp.responseString();
}
else
{
HTTPServerResponse resp(500, output);
response = resp.responseString();
}
}
示例8: getLoadTestRunResults
bool getLoadTestRunResults(SQLiteDB *pDB, HTTPServerRequest &request, std::string &output)
{
if (!pDB)
{
output = "No DB Connection";
return false;
}
std::string sql = "select rowid, datetime(test_time,'localtime') as rtime, overall_error_code, last_response_code, steps from load_test_overall_results";
// sql += " order by rowid desc limit 40";
sql += " where run_id = ";
std::string runID = request.getParam("run_id");
sql += runID;
SQLiteQuery q(*pDB);
output = "";
char szTemp[2048];
int count = 1;
q.getResult(sql);
while (q.fetchNext())
{
memset(szTemp, 0, 2048);
long rowID = q.getLong();
std::string time = q.getString();
long overallErrorCode = q.getLong();
long lastResponseCode = q.getLong();
long steps = q.getLong();
sprintf(szTemp, "<tr>\n <td id=\"l\">%i</td>\n <td id=\"l\">%s</td>\n <td id=\"l\">%ld</td>\n <td id=\"l\">%ld</td>\n <td id=\"l\">%ld</td>\n"
" <td id=\"l\"><a href=\"/load_test_page_results?overall_result_id=%ld\">View Page Result</a></td>\n</tr>\n", count, time.c_str(), overallErrorCode,
lastResponseCode, steps, rowID);
output.append(szTemp);
count ++;
}
return true;
}
示例9: deleteScriptStep
void HTTPServerRequestDespatcher::deleteScriptStep(HTTPServerRequest &request, std::string &response)
{
unsigned long testID = atoi(request.getParam("test_id").c_str());
unsigned long pageID = atoi(request.getParam("page_id").c_str());
std::string output;
if (deleteScriptStepFromDB(m_pMonitoringDB, testID, pageID, output))
{
std::string newURL = "/edit_script_test?test_id=";
char szTemp[8];
memset(szTemp, 0, 8);
sprintf(szTemp, "%ld", testID);
newURL.append(szTemp);
HTTPServerRedirectResponse resp(newURL);
response = resp.responseString();
}
else
{
HTTPServerResponse resp(500, output);
response = resp.responseString();
}
}