遇到一个网页提交的数据是 json 格式,但是里面传入的参数一个是 json query 的查询语句,一个是用户名,使用 Fiddle 可以重发看获取到返回结果,用 python 提交就不行,应该是 json 在传输的过程中没有被正确识别,求大佬指教。
网页端原传入参数为
{"query":"\n query Profile($usernameOrAddress: String!) {\n profile(usernameOrAddress: $usernameOrAddress) {\n id\n username\n pfp {\n ...FullBareAsset\n }\n decagon {\n ...FullBareAsset\n }\n banner {\n ...FullBareAsset\n }\n bio\n twitterUsername\n discordUsername\n showListings\n addresses\n followedByCount\n followingCount\n }\n}\n \n fragment FullBareAsset on BareAsset {\n id\n provider\n contract\n tokenId\n mediaUrl\n previewStorageKey\n previewMimeType\n previewAspectRatio\n storageKey\n mimeType\n tokenUrl\n name\n multimediaUrl\n aspectRatio\n metadata\n}\n ","variables":{"usernameOrAddress":"Datdz172"}}
k = {"query":"\n query Profile($usernameOrAddress: String!) {\n profile(usernameOrAddress: $usernameOrAddress) {\n id\n username\n pfp {\n ...FullBareAsset\n }\n decagon {\n ...FullBareAsset\n }\n banner {\n ...FullBareAsset\n }\n bio\n twitterUsername\n discordUsername\n showListings\n addresses\n followedByCount\n followingCount\n }\n}\n \n fragment FullBareAsset on BareAsset {\n id\n provider\n contract\n tokenId\n mediaUrl\n previewStorageKey\n previewMimeType\n previewAspectRatio\n storageKey\n mimeType\n tokenUrl\n name\n multimediaUrl\n aspectRatio\n metadata\n}\n ","variables":{"usernameOrAddress":"Datdz172"}}
response = requests.post(APIurl, proxies=proxies, json=k, headers=header, verify=False)
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.