Commit 57f2332b authored by justcoding121's avatar justcoding121 Committed by justcoding121

update readme

parent 7cab7913
...@@ -60,7 +60,7 @@ Sample request and response event handlers ...@@ -60,7 +60,7 @@ Sample request and response event handlers
Console.WriteLine(e.RequestURL); Console.WriteLine(e.RequestURL);
if (e.RequestURL.Contains("somewebsite.com")) if (e.RequestURL.Contains("somewebsite.com"))
if ((e.ProxyRequest.Method.ToUpper() == "POST" || e.ProxyRequest.Method.ToUpper() == "PUT") && e.ProxyRequest.ContentLength > 0) if ((e.RequestMethod.ToUpper() == "POST" || e.RequestMethod.ToUpper() == "PUT") && e.RequestContentLength > 0)
{ {
var m = e.GetRequestBody().Replace("a", "b"); var m = e.GetRequestBody().Replace("a", "b");
...@@ -80,9 +80,10 @@ Sample request and response event handlers ...@@ -80,9 +80,10 @@ Sample request and response event handlers
public void OnResponse(object sender, SessionEventArgs e) public void OnResponse(object sender, SessionEventArgs e)
{ {
if (e.ServerResponse.StatusCode == HttpStatusCode.OK) if (e.RequestURL.Contains("somewebsite.com"))
if (e.ResponseStatusCode == HttpStatusCode.OK)
{ {
if (e.ServerResponse.ContentType.Trim().ToLower().Contains("text/html")) if (e.ResponseContentType.Trim().ToLower().Contains("text/html"))
{ {
//Get response body //Get response body
string responseBody = e.GetResponseBody(); string responseBody = e.GetResponseBody();
......
...@@ -69,7 +69,6 @@ namespace Titanium.Web.Proxy.Models ...@@ -69,7 +69,6 @@ namespace Titanium.Web.Proxy.Models
} }
public string GetRequestBody() public string GetRequestBody()
{ {
if ((proxyRequest.Method.ToUpper() == "POST" || proxyRequest.Method.ToUpper() == "PUT") && requestContentLength > 0) if ((proxyRequest.Method.ToUpper() == "POST" || proxyRequest.Method.ToUpper() == "PUT") && requestContentLength > 0)
......
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