From cad925cc90b331542a602b7ab4237f2861b31730 Mon Sep 17 00:00:00 2001 From: jeffcheasey88 <66554203+jeffcheasey88@users.noreply.github.com> Date: Wed, 26 Jul 2023 12:10:31 +0200 Subject: [PATCH] Add Response Status Code & Message --- .../peeratcode/framework/HttpWriter.java | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/be/jeffcheasey88/peeratcode/framework/HttpWriter.java b/src/be/jeffcheasey88/peeratcode/framework/HttpWriter.java index 24356df..819a2aa 100644 --- a/src/be/jeffcheasey88/peeratcode/framework/HttpWriter.java +++ b/src/be/jeffcheasey88/peeratcode/framework/HttpWriter.java @@ -48,8 +48,8 @@ public class HttpWriter{ System.out.println(e[2]+" -> response "+code); } - private static String[] HEIGHTBITS = new String[7]; - private static String[] NINEBITS = new String[206]; + private static String[] HEIGHTBITS = new String[9]; + private static String[] NINEBITS = new String[212]; static { HEIGHTBITS[0] = " OK"; @@ -59,13 +59,17 @@ public class HttpWriter{ HEIGHTBITS[4] = " No Content"; HEIGHTBITS[5] = " Reset Content"; HEIGHTBITS[6] = " Partial Content"; + HEIGHTBITS[7] = " Mutli-Status"; + HEIGHTBITS[8] = " Already Reported"; NINEBITS[0] = " Multiple Choices"; NINEBITS[1] = " Moved Permanently"; - NINEBITS[2] = " Temporary Redirect"; + NINEBITS[2] = " Found"; NINEBITS[3] = " See Other"; NINEBITS[4] = " Not Modified"; NINEBITS[5] = " Use Proxy"; + NINEBITS[7] = " Temporary Redirect"; + NINEBITS[8] = " Permanent Redirect"; NINEBITS[100] = " Bad Request"; NINEBITS[101] = " Unauthorized"; @@ -80,11 +84,22 @@ public class HttpWriter{ NINEBITS[110] = " Gone"; NINEBITS[111] = " Length Required"; NINEBITS[112] = " Precondition Failed"; - NINEBITS[113] = " Request Entity Too Large"; - NINEBITS[114] = " Request-URI Too Large"; + NINEBITS[113] = " Payload Too Large"; + NINEBITS[114] = " URI Too Long"; NINEBITS[115] = " Unsupported Media Type"; + NINEBITS[116] = " Range Not Satisfiable"; + NINEBITS[117] = " Expectation Failed"; + NINEBITS[118] = " I'm a Teapot"; + NINEBITS[121] = " Misdirected Request"; + NINEBITS[122] = " Unprocessable Content"; NINEBITS[123] = " Locked"; + NINEBITS[124] = " Failed Dependency"; NINEBITS[125] = " Too Early"; + NINEBITS[126] = " Upgrade Required"; + NINEBITS[128] = " Precondition Required"; + NINEBITS[129] = " Too Many Requests"; + NINEBITS[131] = " Request Header Fields Too Large"; + NINEBITS[151] = " Unavailable For Legal Reasons"; NINEBITS[200] = " Internal Server Error"; NINEBITS[201] = " Not Implemented"; @@ -92,6 +107,11 @@ public class HttpWriter{ NINEBITS[203] = " Service Unavailable"; NINEBITS[204] = " Gateway Timeout"; NINEBITS[205] = " HTTP Version Not Supported"; + NINEBITS[206] = " Variant Also Negotiates"; + NINEBITS[207] = " Insufficient Storage"; + NINEBITS[208] = " Loop Detected"; + NINEBITS[210] = " Not Extended"; + NINEBITS[211] = " Network Authentication Required"; } private static String codeMessage(int code){