各种妖孽

php cURL模拟POST请求,碰到这样的错误:

HTTP/1.0 417 Expectation failed
Server: squid
Date: Fri, 02 Mar 2012 16:08:46 GMT
Content-Type: text/html
Content-Length: 1563
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from none.net
Via: 1.0 none.net:80 (squid)
Connection: close

请求头
POST /abc.php HTTP/1.1
User-Agent: Internal Callback
Host: www.abc.com
Accept: */*
Content-Length: 14598
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue

解决方案:设置CURLOPT_HTTPHEADER为array(‘Expect:’)

参考链接:
http://chrismckee.co.uk/curl-http-417-expectation-failed/
http://www.shesek.info/php/http-error-417-with-php-curl

Tornado实时行情报价

用Tornado实现了一个实时行情报价系统,长轮询,一个简单的应用,从看文档查资料到实现。
花了大概两个小时。
好惊讶。

继续玩python:)

接下来要做点其他好玩的东西了。