Open alec1o opened 1 month ago
Solved at: 6a793924e344cc3fdbdb18b77b5837027d576c24
I @ale1o @aleciofuranze (Alecio Furanze) Currently, there are no built-in parsers for Enctype, but the mechanism to implement middleware for parsing is already in place. In future versions, we will add built-in parsers for Enctypes such as JSON, XML, and YAML. This will reduce the need to manually create Enctype parsers to process the request body. However, even after the addition of these integrated parsers, you can still choose to use a more sophisticated parser, and the library will continue to support these parsing options via middleware in case you need to parse unsupported Enctypes or for any other reason. The key difference is that the built-in parsers will be available by default.
Enctype | Status |
---|---|
š UrlEncoded | ā³ Planned |
š Multipart | ā³ Planned |
š Json | ā³ Planned |
š Yaml | ā³ Planned |
šļø Xml | ā³ Planned |
š Csv | ā³ Planned |
āļø GraphQL | ā³ Planned |
š¦ SoapXml | ā³ Planned |
š MultipartRelated | ā³ Planned |
Enctype
is scheduled to be added in future versions with parsing support.Enctype
already has built-in parsing support in the library.
Description:
HTTP.Body.Enctype
is already detected and saved, allowing us to simplify parsing the body content. The methodHTTP.Body.Parse<T>()
will use this detectedenctype
to automatically parse the content.HTTP.Body.OnParse(HTTP.Enctype enctype, bool replaceOnMatch, Func<Type, object>)
Used to set parser configuration.Key Points:
HTTP.Body.Enctype
: Detected and saved separately.HTTP.Body.Parse<T>()
: Uses the savedenctype
to parse content based on the type (e.g., JSON, form data).Benefits:
enctype
values.enctype
values.enctype
.replaceOnMatch
Make custom middleware rewrite/override Already set parser handlerExample Usage:
Usage middleware to parse HTTP.Body