use phpunit assertInternalType method instead of deprecated assertType
encode fields sent over curl only when we really need it