本文整理汇总了C++中HttpResponse::getErrorBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ HttpResponse::getErrorBuffer方法的具体用法?C++ HttpResponse::getErrorBuffer怎么用?C++ HttpResponse::getErrorBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpResponse
的用法示例。
在下文中一共展示了HttpResponse::getErrorBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: httpRequestDidCompleted
void RequestManager::httpRequestDidCompleted(Object *sender, network::HttpResponse *data){
HttpResponse *response = data;
HttpRequest *request = response->getHttpRequest();
BLOCK()
const char *type = request->getTag();
if (!response || !strlen(type)){
LEAVE()
}
log(1,"%s completed", type);
int statusCode = response->getResponseCode();
char statusString[64] = {};
sprintf(statusString, "HTTP Status Code=>%d, tag = %s", statusCode, request->getTag());
log(1,"response code==>%d", statusCode);
if (!response->isSucceed()){
log(1,"response failed");
log(1,"error buffer: %s", response->getErrorBuffer());
std::string temName = response->getErrorBuffer();
if (temName.length() > 0){
if (!((unsigned)temName[0]&0x80)){
//you need to translate ascii to chinese
}
}
this->dispatchRequestDidFail(type, temName.c_str());
LEAVE()
}