You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to access Cookies and Query Params inside of my handler.
I found that from the official documentation about triggercontexts that there is a way of accessing some parameters of HttpContext via IContextProvider injection which works like below code and it is very handy.
internal class CallbackHttpRequestHandler : CommandHandlerBase<CallbackHttpRequestDto, IActionResult>
{
private readonly IContextProvider _contextProvider;
public CallbackHttpRequestDtoHandler(IContextProvider contextProvider) : base(false)
{
_contextProvider = context;
}
protected override async Task<IActionResult> ExecuteAsync(CallbackHttpRequestDto request, IActionResult previousResult)
{
if (_contextProvider.HttpContext != null)
{
var headers = _context.HttpContext.Headers;
var requestUrl = _context.HttpContext.RequestUrl;
var claimsPrincipal = _context.HttpContext.ClaimsPrincipal;
}
}
}
But there is no mapping between original HttpRequest Cookies collections and I need it.
How can I achieve that? I found it not easy inside the SDK to pass this Cookies collection. Please help.
The text was updated successfully, but these errors were encountered:
imanabidi
changed the title
How to access Cookie collection (and QueryString) collection ?
How to access Cookie (and QueryString) collection ?
Jul 10, 2020
I need to access Cookies and Query Params inside of my handler.
I found that from the official documentation about triggercontexts that there is a way of accessing some parameters of HttpContext via IContextProvider injection which works like below code and it is very handy.
But there is no mapping between original HttpRequest Cookies collections and I need it.
How can I achieve that? I found it not easy inside the SDK to pass this Cookies collection. Please help.
Also posted here on SO
The text was updated successfully, but these errors were encountered: