|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using App.Utilities.Web.Handlers;
namespace CodeProject.GenericHandler
{
public class HttpVerbsHandler : BaseHandler
{
public override object GET()
{
//SetResponseContentType(ResponseContentTypes.JSON);
return new MyObject() { Name = "GET -> AlexCode", Age = 35 };
}
public override object PUT()
{
SetResponseContentType(ResponseContentTypes.JSON);
return new { Name = "Alex", Age = 35 };
}
[HttpPost]
public object OtherMethod(string name)
{
return string.Format("<b>The OtherMethod say hello to {0}</b>", name);
}
public class MyObject
{
public string Name { get; set; }
public Int32 Age { get; set; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.