我想在python中编写基于PHP的thrift API客户端,例如thirft.apache.org示例客户端:http://thrift.apache.org/
我写这段代码:
//A struture
$up = UserProfile($uid=1,
$name="Mark Slee",
$blurb="I'll find something to put here.");
# Talk to a server via TCP sockets, using a binary protocol
$fp = fsockopen("localhost",9090, $errno, $errstr, 90);
# Use the service we already defined
$service=fwrite($fp, $up);
while (!feof($fp)) {
echo fgets($fp, 128);
}
所以它是python客户端代码的正确替代品:http://thrift.apache.org/
请提出任何建议,因为我是新手。
感谢