本文整理汇总了C++中IEspContext::getResponseFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ IEspContext::getResponseFormat方法的具体用法?C++ IEspContext::getResponseFormat怎么用?C++ IEspContext::getResponseFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEspContext
的用法示例。
在下文中一共展示了IEspContext::getResponseFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFinishUpload
int CFileSpraySoapBindingEx::onFinishUpload(IEspContext &ctx, CHttpRequest* request, CHttpResponse* response, const char *service, const char *method, StringArray& fileNames, StringArray& files, IMultiException *me)
{
if (!me || (me->ordinality()==0))
{
if (ctx.getResponseFormat()==ESPSerializationANY)
{
StringBuffer newUrl, netAddress, path;
request->getParameter("NetAddress", netAddress);
request->getParameter("Path", path);
newUrl.appendf("/FileSpray/DropZoneFiles?NetAddress=%s&Path=%s", netAddress.str(), path.str());
response->redirect(*request, newUrl.str());
}
else
{
IArrayOf<IEspDFUActionResult> results;
Owned<CUploadFilesResponse> esp_response = new CUploadFilesResponse("FileSpray");
ForEachItemIn(i, fileNames)
{
const char* fileName = fileNames.item(i);
Owned<IEspDFUActionResult> res = createDFUActionResult("", "");
res->setID(fileName);
res->setAction("Upload File");
res->setResult("Success");
results.append(*res.getLink());
}
if (!results.length())
{
Owned<IEspDFUActionResult> res = createDFUActionResult("", "");
res->setID("<N/A>");
res->setAction("Upload File");
res->setResult("No file uploaded");
results.append(*res.getLink());
}
esp_response->setUploadFileResults(results);
MemoryBuffer content;
StringBuffer mimetype;
esp_response->appendContent(&ctx,content, mimetype);
response->setContent(content.length(), content.toByteArray());
response->setContentType(mimetype.str());
response->send();
}
}
else
{