Skip to content

Instantly share code, notes, and snippets.

@Calzzetta
Created June 2, 2015 19:21
Show Gist options
  • Save Calzzetta/8ddeffc81931d22ef716 to your computer and use it in GitHub Desktop.
Save Calzzetta/8ddeffc81931d22ef716 to your computer and use it in GitHub Desktop.
POST SOAP using urllib2
import urllib2
REQUEST_URL = 'url do server'
HEADERS = {'content-type':'text/x-xml'}
def post_soap(msg):
req = urllib2.Request(REQUEST_URL, msg, HEADERS)
r = urllib2.urlopen(req)
returned_line = ''.join(r.readlines())
return returned_line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment