public virtual void OnHttpFinish(QQHttpResponse response) { try { string type = response.GetContentType() ?? ""; if ((type.StartsWith("application/x-javascript") || type.StartsWith("application/json") || type.Contains("text") ) && response.GetContentLength() > 0) { MyLogger.Default.Debug(response.GetResponseString()); } if (response.ResponseCode == QQHttpResponse.S_OK) { OnHttpStatusOK(response); } else { OnHttpStatusError(response); } } catch (QQException e) { NotifyActionEvent(QQActionEventType.EVT_ERROR, e); } catch (JsonException e) { NotifyActionEvent(QQActionEventType.EVT_ERROR, new QQException(QQErrorCode.JSON_ERROR, e)); } catch (Exception e) { NotifyActionEvent(QQActionEventType.EVT_ERROR, new QQException(QQErrorCode.UNKNOWN_ERROR, e)); } }
public virtual void OnHttpFinish(QQHttpResponse response) { var type = response.GetContentType(); if (type != null && (type.StartsWith("application/x-javascript") || type.StartsWith("application/json") || type.Contains("text") ) && response.GetContentLength() > 0) { // Context.Logger.LogDebug(response.GetResponseString()); } if (response.ResponseCode == QQHttpResponse.S_OK) { OnHttpStatusOK(response); } else { OnHttpStatusError(response); } }