Review HTTP method enum definition to avoid collisions with plaforms ones#413
Merged
willmmiles merged 1 commit intomainfrom Mar 15, 2026
Merged
Review HTTP method enum definition to avoid collisions with plaforms ones#413willmmiles merged 1 commit intomainfrom
willmmiles merged 1 commit intomainfrom
Conversation
willmmiles
approved these changes
Mar 14, 2026
There was a problem hiding this comment.
Pull request overview
Updates the library’s HTTP method handling to avoid collisions with platform-defined HTTP_ANY macros and to support a broader set of HTTP methods, while centralizing method string conversions.
Changes:
- Reworked HTTP method enum/composite handling and introduced
HTTP_ALL(withHTTP_ANYdeprecated when possible). - Replaced inline parsing/stringification logic with
asyncsrv::stringToMethod/asyncsrv::methodToString. - Updated handlers, examples, and docs to use the new method matching approach and
HTTP_ALL.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ESPAsyncWebServer.h | Redefines method enum/composite types, adds HTTP_ALL, and introduces optional external http_method integration. |
| src/WebRequest.cpp | Switches request method storage to a single method and delegates parsing/string conversion. |
| src/WebHandlers.cpp | Updates handler method checks to use WebRequestMethodComposite::matches(). |
| src/WebHandlerImpl.h | Defaults callback handler methods to HTTP_ALL. |
| src/AsyncJson.cpp | Uses a shared composite for allowed JSON handler methods and updates matching logic. |
| src/literals.h | Adds string literals for additional HTTP methods; removes ANY literal. |
| examples/HTTPMethods/HTTPMethods.ino | Updates example usage to avoid global method names and tests backward-compatible matching. |
| docs/setup.md | Replaces HTTP_ANY with HTTP_ALL in examples. |
| docs/backup/wiki.md | Replaces HTTP_ANY with HTTP_ALL in archived examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4341ec7 to
0ba9308
Compare
…ones Formalize operations on WebServerRequestMethod - Requests can be only one method - String operations are free functions - Function for matching composites Handle collisions with other webservers Fix HTTP_ANY macro conflict with Arduino core. Rename the combination value to HTTP_ALL and make it type-safe as a WebRequestMethodComposite. Ensure a warning is generated when conflicts are detected, and add a deprecation alert to our compatibility HTTP_ANY value. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: mathieucarbou <61346+mathieucarbou@users.noreply.github.com> Fix for #404 Fix name collision warning Added support for standard HTTP methods for WebDAC and REST APIs. Move global utility methods in asyncsrv namespace to avoid conflict with existing usr code Improving example to make sure the old way to match with a bit operator (&) works. Improve external HTTP method integration ci(pre-commit): Apply automatic fixes Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Updated examples to show teh difference between using Arduino Core include and ESP-IDf include
0ba9308 to
8234c1c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.