Commit 700129a2 authored by justcoding121's avatar justcoding121

GetAllHeaders API

parent 478dcc97
using System; using System;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Extensions;
...@@ -343,6 +344,20 @@ namespace Titanium.Web.Proxy.Http ...@@ -343,6 +344,20 @@ namespace Titanium.Web.Proxy.Http
return null; return null;
} }
/// <summary>
/// Returns all headers
/// </summary>
/// <returns></returns>
public List<HttpHeader> GetAllHeaders()
{
var result = new List<HttpHeader>();
result.AddRange(RequestHeaders.Select(x => x.Value));
result.AddRange(NonUniqueRequestHeaders.SelectMany(x => x.Value));
return result;
}
/// <summary> /// <summary>
/// Add a new header with given name and value /// Add a new header with given name and value
/// </summary> /// </summary>
......
using System; using System;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
...@@ -278,6 +279,20 @@ namespace Titanium.Web.Proxy.Http ...@@ -278,6 +279,20 @@ namespace Titanium.Web.Proxy.Http
return null; return null;
} }
/// <summary>
/// Returns all headers
/// </summary>
/// <returns></returns>
public List<HttpHeader> GetAllHeaders()
{
var result = new List<HttpHeader>();
result.AddRange(ResponseHeaders.Select(x => x.Value));
result.AddRange(NonUniqueResponseHeaders.SelectMany(x => x.Value));
return result;
}
/// <summary> /// <summary>
/// Add a new header with given name and value /// Add a new header with given name and value
/// </summary> /// </summary>
......
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