We use python requests library to make HTTPS post calls to arcgis online and to arcgis server. you can use urllib2, but we really like using requests. After you have that, these are the params we use to pass to the endpoint.