在使用微盟的接口时,遇到这样的规定:
1、正向接口以’Content-Type: application/json’ 格式推送至微盟平台

2、所有正向接口的调用均以post方式提交,并且post中的参数均以json方式构成。

一开始没看懂,不知道什么玩意.百度后,找到了个靠谱的帖子,照着方案写代码后成功,把相关代码贴出来,供以后作参考

import urllib2
import json

data = {
    'a': 123,
    'b': 456
}
headers = {'Content-Type': 'application/json'}
request = urllib2.Request(url='url', headers=headers, data=json.dumps(data))
response = urllib2.urlopen(request)

主要是head要加一段代码指明用Json方式发送

GitHub 加速计划 / js / json
57
5
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 个月前 )
68c25aec * :memo: update customers Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :memo: add badge to Cloudback Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me> 3 天前
ac0133ea Bumps [mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin) from 1.4.5 to 1.4.6. - [Release notes](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/releases) - [Commits](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/compare/v1.4.5...v1.4.6) --- updated-dependencies: - dependency-name: mkdocs-git-revision-date-localized-plugin dependency-version: 1.4.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 4 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐