首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RPC C++调用

RPC C++调用
EN

Stack Overflow用户
提问于 2012-01-24 11:37:16
回答 1查看 341关注 0票数 0

我还没有看到通过输入某些字符串来调用XML-RPC,并通过连接到XML在c++中获得某些字符串响应的文档。这是服务器提供的文档。我想不出该怎么做

代码语言:javascript
复制
    A client can interact with a Pandorabot by POST'ing to:

    http://www.pandorabots.com/pandora/talk-xml
    The form variables the client needs to POST are:

    botid - see H.1 above.
    input - what you want said to the bot.
    custid - an ID to track the conversation with a particular customer. This variable is optional. If you don't send a value Pandorabots will return a custid attribute value in the <result> element of the returned XML. Use this in subsequent POST's to continue a conversation.
    This will give a text/xml response. For example:

    <result status="0" botid="c49b63239e34d1d5" custid="d2228e2eee12d255">
      <input>hello</input>
      <that>Hi there!</that>
    </result>

    The <input> and <that> elements are named after the corresponding AIML elements for bot 
input and last response.
 If there is an error, status will be non-zero and there will be a human readable <message> element included describing the error. 

For example:
    <result status="1" custid="d2228e2eee12d255">
      <input>hello</input>
      <message>Missing botid</message>
    </result>
EN

回答 1

Stack Overflow用户

发布于 2012-01-24 11:54:36

在C++中通过超文本传输协议进行通信的最简单方法是使用专门为此目的而设计的库。例如,libcurl提供了发送和接收问题中显示的那种请求和响应所需的所有工具。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8981728

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档