json格式错了吧?json用双引号。。单引号不行哦
【报错】:使用POSTMAN调试接口时报以下错误:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>
【原因】原数据的格式不对,使用了单引号。json格式是用双引号,参考:http://www.w3school.com.cn/json/json_syntax.asp
{'image': ['http://img.redocn.com/sheying/20171024/nongcuntupifangdamen_8843329.jpg', 'http://img.redocn.com/sheying/20160926/nongcunlaofang_7139669.jpg', 'http://img.redocn.com/sheying/20170712/pojiudemingqingmatouqianglaofang_8414233.jpg', 'http://img.redocn.com/sheying/20140805/pojiudelaofangzi_2844635.jpg', 'http://img.redocn.com/sheying/20171213/wushanhongchuntujiazuxiangpojiudelaowu_9057737.jpg', 'http://img.redocn.com/sheying/20161230/pojiudenongcunlaozhaisheying_7713869.jpg']}
【解决】修改成以下格式就好了
# 缩进是为了好看哈,不影响代码执行结果
{"image": ["http://img.redocn.com/sheying/20171024/nongcuntupifangdamen_8843329.jpg","http://img.redocn.com/sheying/20160926/nongcunlaofang_7139669.jpg", "http://img.redocn.com/sheying/20170712/pojiudemingqingmatouqianglaofang_8414233.jpg","http://img.redocn.com/sheying/20140805/pojiudelaofangzi_2844635.jpg","http://img.redocn.com/sheying/20171213/wushanhongchuntujiazuxiangpojiudelaowu_9057737.jpg","http://img.redocn.com/sheying/20161230/pojiudenongcunlaozhaisheying_7713869.jpg"]
}