Commit a0760a78 authored by Honfika's avatar Honfika

BodyString is public, fields moved to the correct positon in the source file

parent 5d2bf635
...@@ -11,6 +11,16 @@ namespace Titanium.Web.Proxy.Http ...@@ -11,6 +11,16 @@ namespace Titanium.Web.Proxy.Http
/// </summary> /// </summary>
public class Request public class Request
{ {
/// <summary>
/// Cached request body as byte array
/// </summary>
private byte[] requestBody;
/// <summary>
/// Cached request body as string
/// </summary>
private string requestBodyString;
/// <summary> /// <summary>
/// Request Method /// Request Method
/// </summary> /// </summary>
...@@ -37,7 +47,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -37,7 +47,7 @@ namespace Titanium.Web.Proxy.Http
public Version HttpVersion { get; set; } public Version HttpVersion { get; set; }
/// <summary> /// <summary>
/// Keeps the response body data after the session is finished /// Keeps the request body data after the session is finished
/// </summary> /// </summary>
public bool KeepRequestBody { get; set; } public bool KeepRequestBody { get; set; }
...@@ -171,16 +181,6 @@ namespace Titanium.Web.Proxy.Http ...@@ -171,16 +181,6 @@ namespace Titanium.Web.Proxy.Http
/// </summary> /// </summary>
internal bool CancelRequest { get; set; } internal bool CancelRequest { get; set; }
/// <summary>
/// Cached request body as byte array
/// </summary>
private byte[] requestBody;
/// <summary>
/// Cached request body as string
/// </summary>
private string requestBodyString;
/// <summary> /// <summary>
/// Request body as byte array /// Request body as byte array
/// </summary> /// </summary>
...@@ -213,7 +213,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -213,7 +213,7 @@ namespace Titanium.Web.Proxy.Http
/// Request body as string /// Request body as string
/// Use the encoding specified in request to decode the byte[] data to string /// Use the encoding specified in request to decode the byte[] data to string
/// </summary> /// </summary>
internal string RequestBodyString => requestBodyString ?? (requestBodyString = Encoding.GetString(RequestBody)); public string RequestBodyString => requestBodyString ?? (requestBodyString = Encoding.GetString(RequestBody));
/// <summary> /// <summary>
/// Request body was read by user? /// Request body was read by user?
......
...@@ -11,6 +11,16 @@ namespace Titanium.Web.Proxy.Http ...@@ -11,6 +11,16 @@ namespace Titanium.Web.Proxy.Http
/// </summary> /// </summary>
public class Response public class Response
{ {
/// <summary>
/// Cached response body content as byte array
/// </summary>
private byte[] responseBody;
/// <summary>
/// Cached response body as string
/// </summary>
private string responseBodyString;
/// <summary> /// <summary>
/// Response Status Code. /// Response Status Code.
/// </summary> /// </summary>
...@@ -158,16 +168,6 @@ namespace Titanium.Web.Proxy.Http ...@@ -158,16 +168,6 @@ namespace Titanium.Web.Proxy.Http
/// </summary> /// </summary>
public HeaderCollection ResponseHeaders { get; } = new HeaderCollection(); public HeaderCollection ResponseHeaders { get; } = new HeaderCollection();
/// <summary>
/// Cached response body content as byte array
/// </summary>
private byte[] responseBody;
/// <summary>
/// Cached response body as string
/// </summary>
private string responseBodyString;
/// <summary> /// <summary>
/// Response body as byte array /// Response body as byte array
/// </summary> /// </summary>
...@@ -195,7 +195,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -195,7 +195,7 @@ namespace Titanium.Web.Proxy.Http
/// Response body as string /// Response body as string
/// Use the encoding specified in response to decode the byte[] data to string /// Use the encoding specified in response to decode the byte[] data to string
/// </summary> /// </summary>
internal string ResponseBodyString => responseBodyString ?? (responseBodyString = Encoding.GetString(ResponseBody)); public string ResponseBodyString => responseBodyString ?? (responseBodyString = Encoding.GetString(ResponseBody));
/// <summary> /// <summary>
/// Was response body read by user /// Was response body read by user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment