@@ -87,20 +87,32 @@ httpResponseJson(500, { errorForDeveloper: "", errorForUser: "" });
8787
8888``` typescript
8989const HTTP_HEADER: { [key : string ]: string };
90+ // HTTP_HEADER.CONTENT_LENGTH -> "Content-Length"
9091const HTTP_MEDIA_TYPE: { [key : string ]: string };
92+ // HTTP_MEDIA_TYPE.IMAGE_WEBP -> "image/webp"
9193const HTTP_METHOD: { [key : string ]: string };
94+ // HTTP_METHOD.POST -> "POST"
9295const STATUS_CODE_EMPTY: number [];
96+ // [ 204, 205, 304 ]
9397const STATUS_CODE_REDIRECT: number [];
98+ // [300, 301, 302, 303, 305, 307, 308]
9499const STATUS_CODE_RETRY: number [];
100+ // [502, 503, 504]
95101const STATUS_CODE_TAG: { [key : string ]: number };
102+ // STATUS_CODE_TAG.FORBIDDEN -> 403
96103const STATUS_CODE_TEXT: { [key : string ]: string };
104+ // STATUS_CODE_TEXT["202"] -> "Accepted"
97105function httpResponse(code : number | string , message ? : string | object ): { [key : string ]: any ; };
106+ // httpResponse(202) -> { message: 'Accepted', statusCode: 202 }
98107function httpResponseHtml(code : number | string , message ? : string | object ): string ;
99108function httpResponseJson(code : number | string , message ? : string | object ): string ;
109+ // httpResponseJson(202) -> {"message":"Accepted","statusCode":202}
100110function httpResponseText(code : number | string , message ? : string | object ): string ;
101111function httpResponseXml(code : number | string , message ? : string | object ): string ;
102112function httpStatusCode(code : number | string ): number ;
113+ // httpStatusCode("404") -> 404
103114function httpStatusText(code : number | string ): string ;
115+ // httpStatusText(404) -> "Not Found"
104116```
105117
106118---
0 commit comments