Namespace ToSic.Sxc.WebApi
Classes
- JsonFormatterAttribute
Mark a WebApi to use the modern Json Formatter based on System.Text.Json. Without this, older WebApi Controllers use the Newtonsoft JSON Formatter. Also provides additional configuration to make certain work easier.
- SecureEndpointAttribute
Attribute for WebApi controllers, which automatically decrypts encrypted POST payloads for Web API endpoints. Use this attribute on controller or methods to automatically decrypt incoming POST requests.
It will intercepts POST requests with JSON content, checks for encrypted data, and if present, decrypts the payload using the ToSic.Eav.Security.Encryption.AesHybridCryptographyService. It then deserializes the decrypted data into the expected parameter type and replaces the action arguments. If the payload is not encrypted, the request content remains unchanged.
See Network POST Body Encryption (new v19) for more information.
Enums
- Casing
Determines what casing to use when converting data to JSON. This is for the JsonFormatterAttribute. Can be used as flags, so you can say
Casing = Casing.CamelCase
orCasing = Casing.ObjectPascal | Casing.DictionaryCamel
- EntityFormat
Formats to use for automatic Entity to JSON conversion. This is for the JsonFormatterAttribute. As of now it only has
None
andLight
, in future we plan to extend this with other formats. Default is usuallyLight
.