本文整理汇总了C++中HttpRequestWorker::execute方法的典型用法代码示例。如果您正苦于以下问题:C++ HttpRequestWorker::execute方法的具体用法?C++ HttpRequestWorker::execute怎么用?C++ HttpRequestWorker::execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequestWorker
的用法示例。
在下文中一共展示了HttpRequestWorker::execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: input
void
SWGPrivateApi::getuser() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/getuser");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPrivateApi::getuserCallback);
worker->execute(&input);
}
示例2: myAppIdPathParam
void
SWGCloudFileApi::saveFileData(QString* myAppId, SWGFileBody fileObj) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("file/{my_app_id}");
QString myAppIdPathParam("{"); myAppIdPathParam.append("myAppId").append("}");
fullPath.replace(myAppIdPathParam, stringValue(myAppId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = fileObj.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGCloudFileApi::saveFileDataCallback);
worker->execute(&input);
}
示例3: jobIdPathParam
void
SWGConversionApi::jobsJobIdConversionsGet(QString* xOcToken, QString* xOcApiKey, QString* jobId) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/jobs/{job_id}/conversions");
QString jobIdPathParam("{"); jobIdPathParam.append("jobId").append("}");
fullPath.replace(jobIdPathParam, stringValue(jobId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
// TODO: add header support
// TODO: add header support
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGConversionApi::jobsJobIdConversionsGetCallback);
worker->execute(&input);
}
示例4: idPathParam
void
SWGPlansApi::showPlan(QString* id, qint32 year) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/plans/{id}");
QString idPathParam("{"); idPathParam.append("id").append("}");
fullPath.replace(idPathParam, stringValue(id));
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("year"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(year)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPlansApi::showPlanCallback);
worker->execute(&input);
}
示例5: input
void
SWGMeasurementsApi::measurementSourcesGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/measurementSources");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGMeasurementsApi::measurementSourcesGetCallback);
worker->execute(&input);
}
示例6: jobIdPathParam
void
SWGOutputApi::jobsJobIdOutputGet(QString* conversionId, QString* inputId, QString* xOcToken, QString* xOcApiKey, QString* jobId) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/jobs/{job_id}/output");
QString jobIdPathParam("{"); jobIdPathParam.append("jobId").append("}");
fullPath.replace(jobIdPathParam, stringValue(jobId));
if(fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("conversionId"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(conversionId)));
if(fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("inputId"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(inputId)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
// TODO: add header support
// TODO: add header support
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGOutputApi::jobsJobIdOutputGetCallback);
worker->execute(&input);
}
示例7: loadCombobox
void analyserQ::loadCombobox(){
HttpRequestWorker *worker = new HttpRequestWorker(this);
connect(worker, SIGNAL(on_execution_finished(HttpRequestWorker*)), this, SLOT(fillCombobox(HttpRequestWorker*)));
QString url_str = dbUrl + "/_all_docs";
HttpRequestInput input(url_str, "GET");
//input.add_var("key1", "value1");
//input.add_var("key2", "value2");
worker->execute(&input);
}
示例8: input
void
SWGJobsApi::jobsGet(QString* status, QString* xOcToken, QString* xOcApiKey, SWGNumber* page) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/jobs");
if(fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("status"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(status)));
if(fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("page"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(page)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
// TODO: add header support
// TODO: add header support
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGJobsApi::jobsGetCallback);
worker->execute(&input);
}
示例9: input
void MainWindow::on_pushButton_2_clicked()
{
QString url_str = "http://localhost/rest_example.php";
HttpRequestInput input(url_str, "POST");
QString text = ui->lineEdit->text();
input.add_var("id", text);
HttpRequestWorker *worker = new HttpRequestWorker(this);
connect(worker, SIGNAL(on_execution_finished(HttpRequestWorker*)), this, SLOT(handleResponse(HttpRequestWorker*)));
worker->execute(&input);
}
示例10: on_commandLinkButton_clicked
void textDialog::on_commandLinkButton_clicked()
{
QString text;
//QImage image;
text=ui->plainTextEdit->toPlainText();
QString url_str = "http://iqubebase.com/pollvogue-api/public/image/post";
// QFile imageFile = QFile(fileName);
QString mimeType = "image/png";
HttpRequestInput input(url_str, "POST");
input.add_var("text", text);
input.add_file("image", fileName ,NULL , mimeType);
HttpRequestWorker *worker = new HttpRequestWorker(this);
connect(worker, SIGNAL(on_execution_finished(HttpRequestWorker*)), this, SLOT(handle_result(HttpRequestWorker*)));
worker->execute(&input);
}
示例11: internalUpdateRecords
void RecordUpdater::internalUpdateRecords(RecordUpdater *record)
{
CSVReader csv(record->_filename, record->_columnSeparator,
record->_numLinesToIgnore, record->_stringDelimiter);
csv.load();
QString url = "http://www.hbobroker.com.ar/smartcard/addrecord";
int recCount = csv.recordCount();
for (int i = 0; i < recCount; ++i)
{
HttpRequestInput input(url, "POST");
QStringList rec = csv.record(i);
input.add_var("dni", rec.at(8));
input.add_var("dominio", rec.at(9));
input.add_var("asegurado", rec.at(6));
input.add_var("cobertura", rec.at(22));
input.add_var("poliza", rec.at(1));
input.add_var("vigencia_desde", rec.at(4));
input.add_var("vigencia_hasta", rec.at(5));
input.add_var("modelo", rec.at(11));
input.add_var("anio", rec.at(12));
input.add_var("chasis", rec.at(15));
input.add_var("motor", rec.at(14));
input.add_var("medioPago", "S/D");
input.add_var("Productor", rec.at(24));
HttpRequestWorker *worker = new HttpRequestWorker(record);
connect(worker, &HttpRequestWorker::on_execution_finished, record, &RecordUpdater::on_addRecordFinished);
while(record->_parallelProcesses > 2)
{
QThread::sleep(1);
//QApplication::processEvents();
}
worker->execute(&input);
record->_parallelProcesses++;
}
}
示例12: input
void
SWGPlansApi::findPlans(SWGRequestPlanFind body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/plans/search");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPlansApi::findPlansCallback);
worker->execute(&input);
}
示例13: appIdPathParam
void
SWGCloudFileApi::saveFile(QString* appId, QString* fileObj, QString* key, SWGHttpRequestInputFileElement* fileToUpload) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("file/{app_id}");
QString appIdPathParam("{"); appIdPathParam.append("appId").append("}");
fullPath.replace(appIdPathParam, stringValue(appId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
if (key != NULL) {
input.add_var("key", *key);
}
if (fileObj != NULL) {
input.add_var("fileObj", *fileObj);
}
if (fileToUpload != NULL) {
input.add_file("fileToUpload", *fileToUpload.local_filename, *fileToUpload.request_filename, *fileToUpload.mime_type);
}
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGCloudFileApi::saveFileCallback);
worker->execute(&input);
}
示例14: appIdPathParam
void
SWGCloudQueryApi::distinct(QString* appId, QString* tableName, SWGCloudQueryDistinct body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("data/{app_id}/{table_name}/distinct");
QString appIdPathParam("{"); appIdPathParam.append("appId").append("}");
fullPath.replace(appIdPathParam, stringValue(appId));
QString tableNamePathParam("{"); tableNamePathParam.append("tableName").append("}");
fullPath.replace(tableNamePathParam, stringValue(tableName));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGCloudQueryApi::distinctCallback);
worker->execute(&input);
}
示例15: appIdPathParam
void
SWGCloudQueueApi::addMessage(QString* appId, QString* queueName, SWGQueueBody body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("queue/{app_id}/{queue_name}/message");
QString appIdPathParam("{"); appIdPathParam.append("appId").append("}");
fullPath.replace(appIdPathParam, stringValue(appId));
QString queueNamePathParam("{"); queueNamePathParam.append("queueName").append("}");
fullPath.replace(queueNamePathParam, stringValue(queueName));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGCloudQueueApi::addMessageCallback);
worker->execute(&input);
}