MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / setPostMode

Method setPostMode

src/common/cURLManager.cpp:234–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234void cURLManager::setPostMode(const std::string& _postData) {
235 CURLcode result;
236
237 postData = _postData;
238
239 result = curl_easy_setopt(easyHandle, CURLOPT_POSTFIELDS, postData.c_str());
240 if (result != CURLE_OK) {
241 debugf(1, "CURLOPT_POSTFIELD error %d : %s\n", result, errorBuffer);
242 }
243 result = curl_easy_setopt(easyHandle, CURLOPT_POSTFIELDSIZE, postData.size());
244 if (result != CURLE_OK) {
245 debugf(1, "CURLOPT_POSTFIELD error %d : %s\n", result, errorBuffer);
246 }
247 result = curl_easy_setopt(easyHandle, CURLOPT_POST, 1);
248 if (result != CURLE_OK) {
249 debugf(1, "CURLOPT_POST error %d : %s\n", result, errorBuffer);
250 }
251}
252
253
254void cURLManager::setHTTPPostMode() {

Callers

nothing calls this directly

Calls 4

curl_easy_setoptFunction · 0.85
debugfFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected