Created
November 1, 2015 02:21
-
-
Save venkyvb/e3b1084349604e2547df to your computer and use it in GitHub Desktop.
Python OData Read Metadata
This file contains hidden or 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 urllib2, base64 | |
username = "user_name_here" | |
password = "password_here" | |
request = urllib2.Request("https://myNNNNNN.crm.ondemand.com/sap/c4c/odata/v1/c4codata/$metadata") | |
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '') | |
request.add_header("Authorization", "Basic %s" % base64string) | |
result = urllib2.urlopen(request) | |
content = result.read() | |
print(content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment