encode/decode request.