Add implicit request mapping to `@Head` when the service is mapped to `@Get`
See original GitHub issueMany server frameworks(e.g. Spring, express) create an implicit request mapping to HEAD when there’s a request handler for GET.
The feature can be useful as client sometimes just want to check the existence of resources without receiving the whole body and almost always the handlers for @Get and @Head should be the same.
Currently, armeria needs 3 annotations to do the same thing.
@Get
@Head
@Path("/some-file")
public HttpResponse someFile(ServiceRequestContext ctx) {
// ...
return client.execute(RequestHeaders.of(ctx.method(), "/some-object-storage-path"));
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Using the Spring @RequestMapping Annotation
This annotation maps HTTP requests to handler methods of MVC and REST controllers. ... You can have multiple request mappings for a method....
Read more >Spring 4.3+ Override Default Behavior of @RequestParam for ...
@RequestMapping methods mapped to "GET" are also implicitly mapped to "HEAD", i.e. there is no need to have "HEAD" explicitly declared.
Read more >Spring @RequestMapping - Baeldung
In this tutorial, we'll focus on one of the main annotations in Spring MVC: @RequestMapping. Simply put, the annotation is used to map...
Read more >Annotation Type RequestMapping - Spring
The HTTP request methods to map to, narrowing the primary mapping: GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE. Supported at the type...
Read more >RequestMapping without any attributes behaves as "default ...
Adding a @GetMapping or a @RequestMapping annotation on a Controller handler means that you're mapping this method as a handler and providing ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Parkkibum95 Thanks, it seems no one has started working on this 😆
may i try this? 🚀