Skip to content

Improve type safety of request methods#411

Closed
willmmiles wants to merge 5 commits into
ESP32Async:mainfrom
willmmiles:requestmethod-typing
Closed

Improve type safety of request methods#411
willmmiles wants to merge 5 commits into
ESP32Async:mainfrom
willmmiles:requestmethod-typing

Conversation

@willmmiles
Copy link
Copy Markdown

Some cleanup and formalization of the WebRequestMethodComposite type, with explicit functions for matching methods, and cleanup of the definition values. Includes code adapted from #403 to switch from HTTP_ANY (which conflicts with other web server libraries) to AsyncWebRequestMethod::HTTP_ALL, with appropriate warnings when conflicts are possible.

Should fix #402.

willmmiles and others added 5 commits March 12, 2026 22:29
- Requests can be only one method
- String operations are free functions
- Function for matching composites
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>
@willmmiles
Copy link
Copy Markdown
Author

Moving branch to local repo.

@willmmiles willmmiles closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant