concordia-server/unit-tests/request.py
2015-06-09 13:01:42 +02:00

18 lines
302 B
Python
Executable File

#!/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