I am trying use curl in python with url parameter but it is returning "None", same api with same parameter in php it is working fine. Here is my python code :
from StringIO import StringIO
import pycurl, json
apiurl = 'http://servername.com:7705'
data = json.dumps({"node": "test", "type": "get_by_field"})
c = pycurl.Curl()
c.setopt(pycurl.URL, apiurl)
c.setopt(pycurl.HTTPHEADER, ['Accept: application/json'])
c.setopt(pycurl.POST, 1)
c.setopt(pycurl.POSTFIELDS, data)
response = c.perform()
c.close()
print response
Requestswhich has good API for performing HTTP-requests: docs.python-requests.org/en/master