enforce str to encoded_rquest return

Fix #4169