簡體   English   中英

基於PHP的thrift API客戶端,如python中的thirft.apache.org示例客戶端

[英]PHP based thrift API client like thirft.apache.org example client in python

我想在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/

因為我是新手,請給出任何建議。

謝謝

Thrift Usage頁面查看Thrift Wiki 這在許多支持的語言中有例子,特別是在PHP中有一個示例客戶端

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM