Skip to content

Commit

Permalink
IRequest - Add code example to Headers property
Browse files Browse the repository at this point in the history
Also updated the xml doc, there's new GetHeaderByName and SetHeaderByName methods that should be used where possible.

Resolves #2671
  • Loading branch information
amaitland committed Jun 26, 2019
1 parent aa238b2 commit f77c6d2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions CefSharp/IRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,22 @@ public interface IRequest : IDisposable
ReferrerPolicy ReferrerPolicy { get; }

/// <summary>
/// Header Collection
/// Header Collection - If dealing with headers that only contain a single value then
/// it's easier to use <see cref="SetHeaderByName(string, string, bool)"/> or <see cref="GetHeaderByName(string)"/>.
/// You cannot modify the referrer using headers, use <see cref="SetReferrer(string, ReferrerPolicy)"/>.
/// NOTE: This collection is a copy of the underlying type, to make changes, take a reference to the collection,
/// make your changes, then reassign the collection. At some point this will be replaced with a proper wrapper.
/// </summary>
/// make your changes, then reassign the collection.
/// </summary>
/// <example>
/// This example shows how to modify headers, make sure you reassign the collection
/// once it's been modified.
/// <code>
/// var headers = request.Headers;
/// var userAgent = headers["User-Agent"];
/// headers["User-Agent"] = userAgent + " CefSharp";
/// request.Headers = headers;
/// </code>
/// </example>
NameValueCollection Headers { get; set; }

/// <summary>
Expand Down

0 comments on commit f77c6d2

Please sign in to comment.