MCPcopy Create free account
hub / github.com/bumptop/BumpTop / postHttpRequest

Method postHttpRequest

trunk/win/Source/FlickrClient.cpp:183–204  ·  view source on GitHub ↗

* Make an HTTP post request and return a string * representing the response in json format */

Source from the content-addressed store, hash-verified

181* representing the response in json format
182*/
183QString FlickrClient::postHttpRequest(QString url, QHash<QString, QString> *params, QString filePath, FileTransferEventHandler * handler)
184{
185 QString queryParams = ftManager->encodeParams(*params);
186 QString serverAddr = QString("%1?%2")
187 .arg(url)
188 .arg(queryParams);
189
190 QString fileName = filename(filePath);
191 QSet<QString> fileParamKeys;
192 fileParamKeys.insert("photo");
193 params->insert("photo", filePath);
194
195 FileTransfer ft(FileTransfer::Upload, (handler ? handler : this));
196 ft.setUrl(serverAddr);
197 ft.setParams(*params);
198 ft.setFileParamKeys(fileParamKeys);
199 ft.setTemporaryString();
200 ft.setTimeout(180);
201
202 bool succeeded = ftManager->addPostTransfer(ft, false);
203 return ft.getTemporaryString();
204}
205
206/*
207* Make an http request and return a string

Callers

nothing calls this directly

Calls 8

filenameFunction · 0.85
encodeParamsMethod · 0.80
addPostTransferMethod · 0.80
getTemporaryStringMethod · 0.80
QStringFunction · 0.50
argMethod · 0.45
insertMethod · 0.45
setTimeoutMethod · 0.45

Tested by

no test coverage detected