我遇到了一些麻煩。我正在嘗試發送POST並嘗試跟蹤文檔,但我似乎無法正確理解。通過python發佈Post有問題
在GitHub上:https://github.com/trtmn/Python
引入請求的歡迎!
# Getting documentation from :
#https://docs.python.org/2/howto/urllib2.html
import urllib
import urllib2
url = 'https://hooks.slack.com/services/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'
values = {"username": "webhookbot", "text": "This is posted to #general and comes from a bot named webhookbot.", "icon_emoji": ":ghost:"}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
the_page = response.read()