If-None-Match header always null in asp.net core controller -


i send request "if-none-match" header postman, it's null in controller.

i'm using asp.net core 1.1.

is there wrong code?

enter image description here debug enter image description here code

if (request.headers.containskey("if-none-match")) {     var oldetag = request.headers["if-none-match"].first();     if (cache.get($"tenant-{id}-{oldetag}") != null)     {         return statuscode((int)httpstatuscode.notmodified);     } } 

update 1

i create new request both if-match & if-none-match header, if-match header exists in controller if-none-match still null. enter image description here enter image description here

  • you wrong header in debugger. instead on headerifmatch check headerifnonematch

  • request.headers.containskey("if-none-match") - code fine , works me via postman. but, accordingly screenshot, looks add if-none-match query parameter, not header.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -