= open("pagesource.txt", "w")file.close()thepage = the_page.encode('utfdecode byte 0xc5 in position 1008: ordinal not in range(128)response['Content-Type'
在烧瓶restful中,基于open规范,我需要确保请求的头部Content-Type设置为application/json;charset=UTF-8,这意味着输入请求是一个JSON,并以UTF-8编码我可以使用以下代码检查JSON: do some thing
但是,如何确保请求和响应是UTF-8编码的,输出也应该是application/json;charset=UTF-8?