Using Azure Resource Manager REST API
<p>I am trying to use Azure ARM REST API. Considering an example to create a Resource group, this is the API mentioned in azure documentation</p>

<pre><code>https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}?api-version={api-version}
</code></pre>

<p>My code:</p>

<pre><code>import httplib, urllib, base64

headers = {
    # Request headers
    'Content-Type': 'application/json',
    'Ocp-Apim-Subscription-Key': 'xxxxxx',
    'Authorization': 'xxxxx',
    'Identifier' : 'xxxxx'
}

params = urllib.urlencode({
"location":"Central US"
})

try:
    conn = httplib.HTTPSConnection('xxxx.azure-api.net')
    conn.request("PUT", "/resourcegroups/resourcename?api-version=2015-01-01%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(response.status)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))
</code></pre>

<p>I am getting a 404 Error. Can you please help me in finding out where I am going wrong. Thank you.</p>