Repository navigation
Conversation
Support has been introduced for HTTP QUERY method as defined in RFC (below), which allows sending idempotent requests while using a content body in them. https://greenbytes.de/tech/specs/draft-ietf-httpbis-safe-method-w-body-latest.html - The keyword 'query' is now available from Dancer2::Core::DSL - The type 'QUERY' has been added to the list of supported methods in Dancer2::Core::Types - The ability to deserialise the body of requests has been enabled for 'QUERY' requests in Dancer2::Core::Request - The keyword 'query' has been documented in Dancer2::Manual::Keywords - Add unit tests in t/route_query.t covering route matching and body parsing Fixes PerlDancer#1794
|
Firstly - many thanks for your contribution! If the HTTP I will do a more detailed review soon, but my initial spots and knee-jerk "need to think about these" points:
(should that bit of code emit a warning if a DSL keyword get skipped, to avoid surprises?) Something we probably want to think about in general, and may want to emphasise in release notes - if you already have a
|
|
@bigpresh Thanks for quick review. I will go through each point you raised and get back to you. |
Completes the HTTP QUERY method implementation by addressing missing DSL route dispatch mechanisms, predicate helpers, keyword ordering, and unit tests: - Add 'query' to the default HTTP method list in Dancer2::Core::DSL::any - Implement missing '$request->is_query' helper method in Dancer2::Core::Request - Reorder 'query' keyword in dsl_keywords hash to maintain alphabetical order - Update t/http_methods.t to test QUERY requests in the core HTTP method matrix
|
@bigpresh, I have updated the PR to address all issues raised so far:
Regarding the observation about app functions silently overriding DSL keywords during export ( |
|
My PR from yesterday addresses the |
Completes the HTTP QUERY method implementation by addressing missing DSL route dispatch mechanisms, predicate helpers, keyword ordering, and unit tests: - Add 'query' to the default HTTP method list in Dancer2::Core::DSL::any - Implement missing '$request->is_query' helper method in Dancer2::Core::Request - Reorder 'query' keyword in dsl_keywords hash to maintain alphabetical order - Update t/http_methods.t to test QUERY requests in the core HTTP method matrix
|
@manwar Nice work! Looks like you took care of most all of @bigpresh 's findings. I'll create a separate ticket for the "single source of truth" for supported HTTP verbs. Just to spell out the potential breakage by the
These can be covered in the release announcement/Changes/similar. I just don't want them to get lost :) Two other minor things I found:
Thanks for doing this! Looking forward to merging it. |
|
@cromedome thanks for review. I have fixed the broken link and updated pod as you correctly pointed out. |
[Dancer2/Core/Types.pm]: Added 'query' to Dancer2Method section [Dancer2/Core/Types.pm]: Added 'QUERY' to Dancer2HTTPMethod section [Dancer2/Manual/Keywords.pod]: Moved pod about 'query' after 'put' [Dancer2/Manual.pod]: Fixed typo in pod for 'QUERY'
|
Thanks @SysPete. I have pushed the changes as per your suggestions. Please review when you get time. |
|
👍 thanks, @manwar! Merging. |
|
@cromedome @bigpresh @SysPete Thank you. |
Summary
Resolves #1794. This PR introduces support for the HTTP QUERY method (draft-ietf-httpbis-safe-method-w-body), allowing application developers to define route handlers that accept complex, safe, body-based search parameters.
https://greenbytes.de/tech/specs/draft-ietf-httpbis-safe-method-w-body-latest.html
Key Changes
t/route_query.tcovering route matching and body parsingTesting Instructions
Run the test suite: