forked from PPolza/XServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHttp.cs
35 lines (31 loc) · 803 Bytes
/
Http.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace XServer
{
public class Http
{
static Dictionary<int, string> codes = new Dictionary<int, string>();
public static void Init()
{
codes[404] = "404 Not Found";
codes[200] = "200 OK";
codes[206] = "206 Partial Content";
codes[307] = "307 Temporary Redirect";
codes[403] = "403 Forbidden";
}
public static string GetFullCode(int code)
{
if (codes.ContainsKey(code))
{
return codes[code];
}
else
{
return code.ToString() + " UNKNOWN";
}
}
}
}