There are specific CTL functions designed to deal with Data Service input and output. See Data Service HTTP Library Functions.