我收到了text/html的响应.如何转换为JSON。我试过JSON.parse和JSON.stringfy,但是它不起作用。当我试图访问它的属性时,我得到了一个未定义的值。
使用JOSN.stringfy的响应如下所示
:“成功”:真,“响应”:{property_api_item_id "63",“财产”:“房屋或租金”,“property_title”:“1 xxxx",”property_content“:,“property_category”:“住宅租赁”、“property_category_id”:“44”、“property_price”:“377 pcm”、“property_location”:“ygt、HU5”、“property_country”:“IN”、“property_latitude”:“57.0989080”,“property_longitude”:“87.3489608”,
发布于 2020-08-17 08:34:34
响应是HTTP响应。在这种情况下,您应该在请求头中添加一个“Content:application/json”,然后对响应执行一个JSON.parse。那应该管用..。
我希望这是有用的。再见
https://stackoverflow.com/questions/63429979
复制相似问题