Fixes encoding/decoding in Client#request

Cf. the discussion in #149 and the comment included in this commit.