~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/ServiceStack/src/ServiceStack.Common/Web/HttpMethods.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using ServiceStack.ServiceHost;
 
3
 
 
4
namespace ServiceStack.Common.Web
 
5
{
 
6
    public static class HttpMethods
 
7
    {
 
8
        public const string Get = "GET";
 
9
        public const string Put = "PUT";
 
10
        public const string Post = "POST";
 
11
        public const string Delete = "DELETE";
 
12
        public const string Head = "HEAD";
 
13
        public const string Options = "OPTIONS";
 
14
        public const string Patch = "PATCH";
 
15
 
 
16
        public static EndpointAttributes GetEndpointAttribute(string httpMethod)
 
17
        {
 
18
            switch (httpMethod.ToUpper())
 
19
            {
 
20
                case Get:
 
21
                    return EndpointAttributes.HttpGet;
 
22
                case Put:
 
23
                    return EndpointAttributes.HttpPut;
 
24
                case Post:
 
25
                    return EndpointAttributes.HttpPost;
 
26
                case Delete:
 
27
                    return EndpointAttributes.HttpDelete;
 
28
                case Patch:
 
29
                    return EndpointAttributes.HttpPatch;
 
30
                case Head:
 
31
                    return EndpointAttributes.HttpHead;
 
32
            }
 
33
 
 
34
            return EndpointAttributes.None;
 
35
        }
 
36
    }
 
37
}