diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index f2f36cc1..13fd0a20 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -36,5 +36,5 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.3.0.0905")] -[assembly: AssemblyFileVersion("3.3.0.0905")] +[assembly: AssemblyVersion("3.3.0.0904")] +[assembly: AssemblyFileVersion("3.3.0.0904")] diff --git a/TShockAPI/RestManager.cs b/TShockAPI/RestManager.cs index 17bc0413..2ce4abd0 100644 --- a/TShockAPI/RestManager.cs +++ b/TShockAPI/RestManager.cs @@ -17,9 +17,21 @@ namespace TShockAPI { public void RegisterRestfulCommands() { Rest.Register(new RestCommand("/HelloWorld/name/{username}", usertest)); + //Rest.Register(new RestCommand("/wizard/{username}", wizard)); } #region RestMethods + + //The Wizard example, for demonstrating the response convention: + object wizard(RestVerbs verbs, IParameterCollection parameters, RequestEventArgs request) + { + var returnBack = new Dictionary(); + returnBack.Add("status", "200"); //Keep this in everything, 200 = ok, etc. Standard http status codes. + returnBack.Add("error", "(If this failed, you would have a different status code and provide the error object.)"); //And only include this if the status isn't 200 or a failure + returnBack.Add("Verified Wizard", "You're a wizard, " + verbs["username"]); //Outline any api calls and possible responses in some form of documentation somewhere + return returnBack; + } + //http://127.0.0.1:8080/HelloWorld/name/{username}?type=status object usertest(RestVerbs verbs, IParameterCollection parameters, RequestEventArgs request) {