请教各位大佬,企业微信是不是禁止 Python 的 post 功能

2018-04-13 09:29:51 +08:00
 ldming
url2='https://qyapi.weixin.qq.com/cgi-bin/create?access_token=%s'%(CDCtoken)
url3='https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=%s&userid=ldming'%(CDCtoken)
values={"userid":"zhangsan",
"name":"哈哈哈",
"english_name":"jackzhang",
"mobile":"15913215421",
"department":[1,2],
"order":[10,40],
"position":"无敌",
"gender":"1",
"email":"zhangsan@gzdev.com",
"isleader":1,
"enable":1,
"avatar_mediaid":"2-G6nrLmr5EC3MNb_-zL1dDdzkd0p7cNliYu9V5w7o8K0",
"telephone":"020-123456",
"extattr":{"attrs":[{"name":"无敌","value":"无敌"},{"name":"无敌","value":"1234567234"}]},}
#newMenber=json.dumps(values).encode(encoding='utf-8')
newMenber=json.dumps(values,ensure_ascii=True).encode(encoding='utf-8')
#send_request=urllib.request.urlopen(url2,newMenber)
#response=json.loads(urllib.request(send_request).read())
Req=urllib.request.urlopen(url2,newMenber)
Requtf=Req.read().decode('utf-8')
print(Requtf)



File "weixin.py", line 42, in <module>
Req=urllib.request.urlopen(url2,newMenber)
File "C:\Users\yanqiong\AppData\Local\Programs\Python\Python35\lib\urllib\requ
est.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\yanqiong\AppData\Local\Programs\Python\Python35\lib\urllib\requ
est.py", line 472, in open
response = meth(req, response)
File "C:\Users\yanqiong\AppData\Local\Programs\Python\Python35\lib\urllib\requ
est.py", line 582, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Users\yanqiong\AppData\Local\Programs\Python\Python35\lib\urllib\requ
est.py", line 510, in error
return self._call_chain(*args)
File "C:\Users\yanqiong\AppData\Local\Programs\Python\Python35\lib\urllib\requ
est.py", line 444, in _call_chain
result = func(*args)
File "C:\Users\yanqiong\AppData\Local\Programs\Python\Python35\lib\urllib\requ
est.py", line 590, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found


跑脚本后报 404,求教各位大佬
1033 次点击
所在节点    问与答
2 条回复
julyclyde
2018-04-13 10:42:17 +08:00
建议先学好英语。Menber 是什么?

url2 地址不对,自己回去看文档去!
ldming
2018-04-13 15:59:27 +08:00
@julyclyde 感谢大佬

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/446431

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX