Updaed POST encoding and decoding