将 curl 转换为 python 语言时

When converting curl to python language

我通过这样的行为复制了 curl 数据:

我想将以下 curl 转换为 python 语言。但是curl里面的字典形式的数据是用一种奇怪的形式包裹起来的。**

奇怪的数据形式是这样的:

--data-raw "^{^\^"common^\^":^{^\^"platform^\^":^\^"web^\^",^\^"pcid^\^":^\^"16185750214525097140297^\^",^\^"memberSrl^\^":^\^"^\^",^\^"libraryVersion^\^":^\^"1.3.0^\^",^\^"lang^\^":^\^"ko-KR^\^",^\^"resolution^\^":^\^"1536x864^\^",^\^"eventTime^\^":^\^"2021-05-12T05:40:15.119Z^\^",^\^"web^\^":^{^\^"pvid^\^":^\^"47b25d6b-2f7f-4edd-954e-6afb0413400e^\^",^\^"rvid^\^":^\^"^\^",^\^"url^\^":^\^"https://www.coupang.com/vp/products/281480779?vendorItemId=5246745661&sourceType=SDP_ALSO_VIEWED&rmdId=ed1666c1f69045658605a47bd3500ad9&eventLabel=recommendation_widget_pc_sdp_001&platform=web&rmdABTestInfo=10803:B,8534:A,12823:A,8088:A,8091:A,12574:C&rmdValue=p5269107492:vt-1.0.0:p281480779^\^",^\^"referrer^\^":^\^"https://www.coupang.com/vp/products/5269107492?itemId=7504683294&vendorItemId=74795528373&isAddedCart=^\^"^}^},^\^"meta^\^":^{^\^"schemaId^\^":238,^\^"schemaVersion^\^":27^},^\^"data^\^":^{^\^"productId^\^":281480779,^\^"vendorItemId^\^":5246745661,^\^"itemId^\^":893525515,^\^"sdpVisitKey^\^":^\^"tzygb7zra2s1johxcn^\^",^\^"domain^\^":^\^"sdp^\^",^\^"pageName^\^":^\^"recommendation^\^",^\^"eventName^\^":^\^"sdp_bottom_ads^\^",^\^"rmdValue^\^":^\^"p281480779:sdp_bottom_ads-1.0.0:p3443790,p281480779:sdp_bottom_ads-1.0.0:p1463163,p281480779:sdp_bottom_ads-1.0.0:p1413317797,p281480779:sdp_bottom_ads-1.0.0:p4753927275,p281480779:sdp_bottom_ads-1.0.0:p295539532,p281480779:sdp_bottom_ads-1.0.0:p1947426099,p281480779:sdp_bottom_ads-1.0.0:p1920685625,p281480779:sdp_bottom_ads-1.0.0:p1919127654,p281480779:sdp_bottom_ads-1.0.0:p1406557439,p281480779:sdp_bottom_ads-1.0.0:p4348160225,p281480779:sdp_bottom_ads-1.0.0:p1919127636,p281480779:sdp_bottom_ads-1.0.0:p324721177,p281480779:sdp_bottom_ads-1.0.0:p1661152176,p281480779:sdp_bottom_ads-1.0.0:p2207652674,p281480779:sdp_bottom_ads-1.0.0:p1318104835,p281480779:sdp_bottom_ads-1.0.0:p4541415097,p281480779:sdp_bottom_ads-1.0.0:p6120321,p281480779:sdp_bottom_ads-1.0.0:p200766309,p281480779:sdp_bottom_ads-1.0.0:p5301593450,p281480779:sdp_bottom_ads-1.0.0:p87794416^\^",^\^"feedsId^\^":^\^"02e6ae196d5b45bf93004ff3222a231d^\^",^\^"logType^\^":^\^"impression^\^",^\^"logCategory^\^":^\^"impression^\^"^},^\^"extra^\^":^{^\^"sentTime^\^":^\^"2021-05-12T05:40:15.119Z^\^"^},^\^"campaign^\^":^{^\^"src^\^":^\^"1042016^\^",^\^"spec^\^":^\^"10304903^\^",^\^"sid^\^":^\^"^\^",^\^"lptag^\^":^\^"^쿠^팡^\^",^\^"itime^\^":^\^"20210512143934^\^",^\^"ctag^\^":^\^"HOME^\^",^\^"appver^\^":^\^"^\^",^\^"addtag^\^":^\^"900^\^"^}^}"

我想将数据转换成一个可以在python中处理的字典。

我想知道为什么数据的形式如此不寻常。你能告诉我如何将数据转换为正常形式吗?

怪异几乎可以肯定是因为 cmd 在转义字符方面有不寻常的规则。如果您复制 bash 各种 Curl 命令,它看起来会更好。

它也适用于 Curl-to-Python 转换器 such as this one