src/Simple.OData.Client.Core/ODataClient.cs
/// <summary>
/// Allows callers to manipulate the request headers in between request executions.
/// Useful for retrieval of x-csrf-tokens when you want to update the request header
/// with the retrieved token on subsequent requests.
/// <para>
/// Note that this overrides any current <see cref="ODataClientSettings.BeforeRequest"/> method.
/// </para>
/// </summary>
/// <param name="headers">The list of headers to update.</param>
Allows callers to manipulate the request headers in between request executions.
Useful for retrieval of x-csrf-tokens when you want to update the request header
with the retrieved token on subsequent requests.

Note that this overrides any current  method.
Allows callers to manipulate the request headers in between request executions . Useful for retrieval of x - csrf - tokens when you want to update the request header with the retrieved token on subsequent requests . Note that this overrides any current method .
public void UpdateRequestHeaders(Dictionary<string, IEnumerable<string>> headers)
	{
		_settings.BeforeRequest += (request) =>
		{
			foreach (var header in headers)
			{
				if (request.Headers.Contains(header.Key))
				{
					request.Headers.Remove(header.Key);
				}
				request.Headers.Add(header.Key, header.Value);
			}
		};
	}
public void UpdateRequestHeaders ( Dictionary < string , IEnumerable < string > > headers ) { _settings . BeforeRequest += ( request ) => { foreach ( var header in headers ) { if ( request . Headers . Contains ( header . Key ) ) { request . Headers . Remove ( header . Key ) ; } request . Headers . Add ( header . Key , header . Value ) ; } } ; }
Allows callers to manipulate the request headers in between request executions.
Allows callers to manipulate the request headers in between request executions .
headers
Dictionary<string, IEnumerable<string>>
The list of headers to update.
The list of headers to update .