/// <summary> /// 返回html内容的HttpResponseMessage /// 主要是alert错误信息 /// </summary> /// <param name="message"></param> /// <returns></returns> public static HttpResponseMessage ToHttpResponseScriptMessage(this string message) { string scriptMessage = ScriptMessage.GetMessage(message); HttpResponseMessage httpResponseMessage = new HttpResponseMessage(); httpResponseMessage.Content = new StringContent(scriptMessage, Encoding.UTF8); httpResponseMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); return(httpResponseMessage); }