Created
July 26, 2016 07:55
-
-
Save hatimn02/5eee18eb1167ce6a58f5ce22f4203d9c to your computer and use it in GitHub Desktop.
Python sample code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib import urlencode | |
from urllib2 import Request, urlopen | |
authkey = 'YOUR_AUTHKEY' # Set your Auth-Key here | |
url = 'http://flow.viasocket.com/trigger/sample_url/slack_integration' # Set your socket URL here | |
post_fields = {'foo': 'bar'} # Set POST fields here | |
request = Request(url, urlencode(post_fields).encode()) | |
request.add_header('Auth-Key', authkey) | |
json = urlopen(request).read().decode() | |
print(json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment