Open mdaneri opened 2 months ago
Still missing documentation
Documentation is here now
I'm unsure whether to keep the ConvertTo-PodeSerializedString
and ConvertFrom-PodeSerializedString
.
I wrote them because I was thinking of using them for the async routes, but in the end, I don't need them.
What do you think are those functions useful?
Summary
This pull request adds several new functions to the Pode project for handling web event data and for serializing/deserializing hashtables. The new functions are:
Get-PodeBody
Get-PodeQuery
Get-PodeParameter
ConvertTo-PodeSerializedString
ConvertFrom-PodeSerializedString
New Functions
Get-PodeBody
Retrieves the body data from the current Pode web event. This function is useful for accessing the main content sent in a web request, including PUT, POST, or any other methods that support a body.
Example:
Get-PodeQuery
Retrieves a specific query parameter value from the current Pode web event. This function is useful for accessing query parameters passed in the URL of a web request.
Example:
Get-PodeParameter
Retrieves a specific parameter value from the current Pode web event. This function is useful for accessing parameters passed in the body or URL of a web request.
Example:
ConvertTo-PodeSerializedString
Converts a hashtable to a serialized string using a specified serialization style. It supports various serialization styles such as 'Simple', 'Label', 'Matrix', 'Query', 'Form', 'SpaceDelimited', 'PipeDelimited', and 'DeepObject'. An optional 'Explode' switch can be used to modify the serialization format for certain styles.
This function is useful for example for callback scenarios.
Examples:
ConvertFrom-PodeSerializedString
Converts a serialized string back into a hashtable, automatically detecting the serialization style based on common delimiters and formats.
This function is useful when receiving complex data as a parameter without using JSON, YAML, or XML encoding.
Examples: