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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -