concordia-server/unit-tests/request.py

18 lines
302 B
Python
Raw Normal View History

2015-06-09 13:01:42 +02:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import urllib2
data = {
'operation': 'python',
'data':'foo'
}
req = urllib2.Request('http://localhost')
req.add_header('Content-Type', 'application/json')
response = urllib2.urlopen(req, json.dumps(data)).read()
print response