You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.3 KiB
49 lines
1.3 KiB
using Apewer.Web;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net;
|
|
using System.Text;
|
|
|
|
namespace Apewer.AspNetBridge
|
|
{
|
|
|
|
/// <summary></summary>
|
|
public class HttpResponseMessage : IDisposable
|
|
{
|
|
|
|
/// <summary></summary>
|
|
public HttpContent Content { get; set; }
|
|
|
|
/// <summary></summary>
|
|
public HttpStatusCode StatusCode { get; set; }
|
|
|
|
private string ReasonPhrase { get; set; }
|
|
|
|
private bool IsSuccessStatusCode { get { var code = (int)StatusCode; return code >= 200 && code <= 299; } }
|
|
|
|
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
|
public HttpResponseMessage(HttpStatusCode statusCode = HttpStatusCode.OK)
|
|
{
|
|
var code = (int)StatusCode;
|
|
if (code < 0 || code > 999) throw new ArgumentOutOfRangeException("statusCode");
|
|
StatusCode = statusCode;
|
|
}
|
|
|
|
/// <summary></summary>
|
|
public override string ToString() => "";
|
|
|
|
private bool ContainsNewLineCharacter(string value)
|
|
{
|
|
foreach (char c in value)
|
|
{
|
|
if (c == '\r' || c == '\n') return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/// <summary></summary>
|
|
public void Dispose() { }
|
|
|
|
}
|
|
|
|
}
|
|
|