- Data inside [] is required
- Data inside <> is optional
- Protocol Version -> RESP 2
- Category -> Simple
- First Byte -> +
- Format -> +[string(must not include \r or \n)]\r\n
- Leading and trailing whitespaces not allowed
- Protocol Version -> RESP 2
- Category -> Simple
- First Byte -> -
- Format -> -[simple string]\r\n
- Redis convention -> -<ERROR_NAME(all caps)>[simple string]\r\n
- Leading and trailing whitespaces not allowed
- Protocol Version -> RESP2
- Category -> Simple
- First Byte -> :
- Format -> :<+|->[integer]\r\n
- Protocol Version -> RESP2
- Category -> Aggregate
- First Byte -> $
- Format -> $[length]\r\n[value]\r\n
- Leading and trailing whitespaces are allowed
- Protocol Version -> RESP2
- Category -> Aggregate
- First Byte -> *
- Format -> *[number-of-elements]\r\n[element-1]...[element-n]
- Remember, no need to end it with a \r\n for the array (element already ends with \r\n)
- Protocol Version -> RESP3
- Category -> Simple
- First Byte -> _
- Format -> _\r\n
- Protocol Version ->
- Category ->
- First Byte ->
- Format ->