【问题标题】:how to invoke http method using dp:url-open function如何使用 dp:url-open 函数调用 http 方法
【发布时间】:2021-10-04 10:38:18
【问题描述】:

问题:如何在 XSLT 语言中使用 IBM Datapower dp:url-open 函数调用 http 方法(GET、POST、CREATE 和 DELETE)

要求:xslt中的代码和简而言之的逐步过程理论?

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: xslt ibm-cloud ibm-datapower apiconnect


【解决方案1】:

如果你不学习阅读文档将会很乏味......你的问题在文档中有明确的答案,这里:https://www.ibm.com/docs/en/datapower-gateways/10.0.1?topic=elements-dpurl-open

但是,尝试更详细地解释命令中发生的事情:

<dp:url-open
  target="URL"
  response="xml | binaryNode | ignore | responsecode | responsecode-binary | responsecode-ignore"
  resolve-mode="xml | swa"
  base-uri-node="nodeset"
  data-type="xml | base64 | filename"
  http-headers="nodeset"
  content-type="contentType"
  ssl-proxy="client:profile"
  timeout="seconds"
  http-method="get | patch | post | put | delete | head"
  options="options">
</dp:url-open>

您需要的第一件事显然是 URL。这可以是字符串或变量:

target="https://google.com"
target="{$url_variable}"

默认方法是GET,但对于其他任何方法,您都需要设置http-method 参数。要发布数据并在您将使用的变量中获取响应:

<xsl:variable name="jsp-response">
  <dp:url-open target="http://www.datapower.com/application.jsp">
    <xsl:copy-of select="$some-nodes">
  </dp:url-open>
</xsl:variable>

这将使HTTP POST 请求发送$some-nodes 变量中的数据(正文)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-03
    • 2016-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-19
    • 1970-01-01
    相关资源
    最近更新 更多