iQQ.Net.WebQQCore.Im.Http.QQHttpResponse.GetContentType C# (CSharp) Method

GetContentType() public method

public GetContentType ( ) : string
return string
        public string GetContentType()
        {
            return GetHeader(HttpConstants.ContentType);
        }

Usage Example

Ejemplo n.º 1
0
        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));
            }
        }
All Usage Examples Of iQQ.Net.WebQQCore.Im.Http.QQHttpResponse::GetContentType