Created
October 15, 2014 18:39
-
-
Save gpaterno/8eae080e4d5d33970876 to your computer and use it in GitHub Desktop.
Reproduce bug Centos 7
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
import pycurl | |
import urllib | |
content = {'USERNAME': 'foobar', 'ATTRIBUTE': 'sshkey', 'VALUE': 'ssh-rsa AADDB3NzaC1yc2EAAAABIwAAAQEA6ezbY7Pb9Ld2fRRgIzEaQln66HgJL0MkHPv7fYsU3Eo+8F5gC+gY4nbxCCuvvJ652WltW786Es1kduWpT13gKkT2TCqvXhC+TDbml5Rp9ECvrSs4Xlc2nYQb+MVwbEnnu3c92WaXs4q4Sjj2lTAAo6ftsjT00uqWUbjX1NoshnH9mo34NCnI2XniI50dNfDx4VxMK5ZRn6zoK5D2T9bKEsAHsmQpNKo9ySKai4SMVP/GnhAhyjLQtq5X8COpdH5AUJy4RHYyL0upF0ClvWYnLpPZuPajsoOZgruu3OQz/FP3XsosMZ04ZNL84mSDSBKE/6N2DMBxw9tl4cuHRx1Evw== '} | |
curl = pycurl.Curl() | |
# Default cURL settings | |
curl.setopt(pycurl.VERBOSE, False) | |
curl.setopt(pycurl.FOLLOWLOCATION, False) | |
curl.setopt(pycurl.SSL_VERIFYHOST, 0) | |
curl.setopt(pycurl.SSL_VERIFYPEER, False) | |
url = "http://localhost:5000/test/" | |
curl.setopt(pycurl.CUSTOMREQUEST, "POST") | |
curl.setopt(pycurl.URL, str(url)) | |
curl.setopt(pycurl.POSTFIELDS, urllib.urlencode(content)) | |
try: | |
curl.perform() | |
except pycurl.error, err: | |
print "error", err | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment