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

2024-07-08 07:20:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用请求以以下格式向我的laravel应用程序发送数据

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

{'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"}


Tags: 数据httpscomurldataexamplehtmlwww

热门问题