Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding:utf-8
- import os
- import urllib2
- import json
- import httplib2)
- content = "一些中文"
- body = {
- "touser":"abcdefg",
- "msgtype":"text",
- "text":
- {
- "content": content
- }
- }
- access_token = '1234567890'
- req_url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=' + access_token
- method = 'POST'
- headers['Content-Type'] = 'application/json'
- headers['Accept-Charset'] = 'encoding=utf-8'
- resp, token = http_obj.request(req_url, method, headers=headers, body=json.dumps(body))
- json.dumps(body, ensure_ascii=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement