2019-02-14 09:14:50 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Runtime.Remoting.Messaging;
|
|
|
|
|
namespace ln.http
|
|
|
|
|
{
|
|
|
|
|
public class HttpStatusCodes
|
|
|
|
|
{
|
|
|
|
|
static Dictionary<int, string> statusMessages = new Dictionary<int, string>()
|
|
|
|
|
{
|
|
|
|
|
{ 200, "Ok" },
|
2019-04-16 18:22:59 +02:00
|
|
|
|
{ 201, "Created" },
|
|
|
|
|
{ 202, "Accepted" },
|
|
|
|
|
{ 204, "No Content" },
|
2019-02-14 09:14:50 +01:00
|
|
|
|
{ 403, "Access denied" },
|
|
|
|
|
{ 404, "Not Found" },
|
|
|
|
|
{ 500, "Internal Error" }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static String GetStatusMessage(int code){
|
|
|
|
|
if (statusMessages.ContainsKey(code))
|
|
|
|
|
return statusMessages[code];
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|