|  Download The JSON Sugar TraitThe methods here are similar to the string methods, except: 
They assume that the message body is a valid JSON string
They dcode the message body into an array
 decodeSymmetricAuthenticatedJsonRequest()/decodeSymmetricAuthenticatedJsonResponse()
Function prototypes: function decodeSymmetricAuthenticatedJsonRequest(
    RequestInterface $request,
    SharedAuthenticationKey $key
): array;
function decodeSymmetricAuthenticatedJsonResponse(
    ResponseInterface $response,
    SharedAuthenticationKey $key
): array;
 decodeSignedJsonRequest()/decodeSignedJsonResponse()
Function prototypes: function decodeSignedJsonRequest(
    RequestInterface $request,
    SigningPublicKey $publicKey
): array;
function decodeSignedJsonResponse(
    ResponseInterface $response,
    SigningPublicKey $publicKey
): array;
 decryptJsonRequestWithSharedKey()/decryptJsonResponseWithSharedKey()
Function prototypes: function decryptJsonRequestWithSharedKey(
    RequestInterface $request,
    SharedEncryptionKey $key
): array;
function decryptJsonResponseWithSharedKey(
    ResponseInterface $response,
    SharedEncryptionKey $key
): array;
 unsealJsonRequest()/unsealJsonResponse()
Function prototypes: function unsealJsonRequest(
    RequestInterface $request,
    SealingSecretKey $secretKey
): array;
function unsealJsonResponse(
    ResponseInterface $response,
    SealingSecretKey $secretKey
): array;
 |