Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / third_party / Promises / polyfill / util / post.py
1 # Copyright 2012:
2 #      Alex Russell <slightlyoff@chromium.org>
3 #
4 # Use of this source code is governed under the Apache License, Version 2.0
5 #    http://www.apache.org/licenses/LICENSE-2.0
6 #
7
8 import httplib, urllib, fileinput
9
10 if __name__ == "__main__":
11   params = urllib.urlencode({
12     "js_code": ''.join([ line for line in fileinput.input() ])
13   })
14   headers = {
15     "Content-type": "application/x-www-form-urlencoded",
16     "Accept": "text/plain"
17   }
18   conn = httplib.HTTPConnection("marijnhaverbeke.nl")
19   conn.request("POST", "/uglifyjs", params, headers)
20   response = conn.getresponse()
21   data = response.read()
22   print data
23   conn.close()