php没有将完整的数据返回给python

时间:2016-12-31 08:02:13

标签: php python

我使用请求

以下列格式将数据发送到我的laravel应用程序

r = requests.post('http://localhost:8000/python-data', data = data) 其中数据字典具有以下格式的数据

{'IN545ELFIBP3NAFAMZ': {'url': 'https://www.example.com/infinix-zero-4-x555-32gb-golden-4g-lte-6453687.html', 'color': 'Golden', 'image_url': 'https://example.com/p/infinix-7770-7863546-1-catalog_grid_3.jpg', 'brand': 'Infinix', 'title_alt': 'Zero 4 X555 - 32GB - Golden - 4G LTE', 'currency': 'Rs.', 'current_price': '22,999', 'old_price': 0, 'discount_percent': 0, 'rating_percent': 'width: 82%', 'total_ratings': '20'}, 'LE650EL10B3WSNAFAMZ': {'url': 'https://www.example.com/lenovo-zuk-z1-64gb-grey-6448906.html', 'color': 'Grey', 'image_url': 'https://example.com/p/lenovo-9978-6098446-1-catalog_grid_3.jpg', 'brand': 'Lenovo', 'title_alt': 'ZUK Z1 - 64GB - Grey', 'currency': 'Rs.', 'current_price': '36,999', 'old_price': 0, 'discount_percent': 0, 'rating_percent': 'width: 85%', 'total_ratings': '5'}}

我将完整的数据返回给python

public function save(Request $request){
        return $request->all();
    }

但是当我在python中打印返回的数据时,这就是我得到的 print(r.text) {"IN545ELFIBP3NAFAMZ":"total_ratings","LE650EL10B3WSNAFAMZ":"total_ratings"}

1 个答案:

答案 0 :(得分:0)

花了几个小时后,唯一的问题是我必须以json

的形式发送数据

StaggeredLayoutManager 它运作良好。