Skip to content

Instantly share code, notes, and snippets.

@koemu
Created December 13, 2013 18:31
Show Gist options
  • Save koemu/7948915 to your computer and use it in GitHub Desktop.
Save koemu/7948915 to your computer and use it in GitHub Desktop.
TENTO 2013-12-14 講義資料
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 簡易HTTPクライアント
# required: Python 2.6 or later
# urllibを使っていますが、これはパッケージインストールの手間を省くためです。
import urllib
URI = "http://www.koemu.com:8888/"
res = urllib.urlopen( URI )
print "HTTP Status: %d" % res.getcode()
print "Body:\n%s" % res.read()
// node.js サンプルページ
// HTTPの挙動を知るために利用します
// required: Node.js 0.6 or later, [email protected]
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.set('Content-Type', 'text/plain');
res.send('Hello World\n');
});
app.listen(8888);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment