- Your class needs to inherit DnnSharp.DnnApiEndpoint.Core.RequestHandlers.IRequestHandler
- Add a reference to System.Web (4.0.0)
- Priority (based on this number DnnApiEndpoint will check if the request is CanParseRequest. Priority 1 is the highest.)
Depending on your application and its needs you may want to handle your request differently than how DnnApiEndpoint does or even add new handlers.1) In your DesktopModules\DnnSharp\DnnApiEndpoint\Config\RequestHandlers folder create a new .json.config file following the examples from .defaults.json.config to specify your new handler.
Adding a new handler is an easy two-step setup.
Here you will need to provide:
Please note that if you add information to .defaults.json.config it will be overwriten/removed on a DnnApiEndpoint update/reinstall.
2) Add your .dll file containing you handler bin\ folder.
- Open VisualStudio
- New Project
- Select Visual C# / ClassLibrary
- Give it a name (CustomRequestHandler)
- Add a reference to DnnSharp.DnnApiEndpoint.Core
- Add a reference to DnnSharp.Common (optional)
- Add a reference to DotNetNuke (optional)
- Write the code in your class (MyCustomHandler.cs)
- Build the project
- Copy the dll in your bin folder
Below you can download examples for both the .json.config and a VisualStudio project for a .dll