etags in Micronaut #10980
-
I am trying to work on etags in Micronaut and started with small Item code using the below codes, mn create-app --build=gradle --jdk=17 --lang=java --test=junit com.example.demo Added class ItemController.java like below, package com.example; import io.micronaut.http.HttpHeaders; @controller("/items")
} Could see the highlighted ifNoneMatch and eTag are not getting recognised. Can you please help what am I missing in this simple code and why the eTag options are not getting accepted. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I assume you are coming from some other framework. These methods you are asking for are just short cuts to retrieving headers. Using headers.get(HttpHeaders.IF_MATCH) and HttpResponse.ok(item).header(HttpHeaders.ETAG, eTag) will achieve what you want. |
Beta Was this translation helpful? Give feedback.
I assume you are coming from some other framework. These methods you are asking for are just short cuts to retrieving headers. Using headers.get(HttpHeaders.IF_MATCH) and HttpResponse.ok(item).header(HttpHeaders.ETAG, eTag) will achieve what you want.