如何使用 Postman 将 XML 数据发布到网络服务?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47295675/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 12:13:24  来源:igfitidea点击:

How do I POST XML data to a webservice with Postman?

xmlweb-servicespostpostman

提问by Stevoisiak

I want POST an XML request to a webservice using Postman. However, when I check the available request formats, I only see options for form-data, x-www-form-urlencoded, raw, and binary.

我想使用 Postman 向 Web 服务 POST 一个 XML 请求。然而,当我检查可用的请求的格式,我只看到了选项form-datax-www-form-urlencodedraw,和binary

How do I POST an XML request to a webservice with Postman?

如何使用 Postman 向 Web 服务发布 XML 请求?

回答by Stevoisiak

Send XML requests with the rawdata type, then set the Content-Type to text/xml.

使用raw数据类型发送 XML 请求,然后将 Content-Type 设置为text/xml



  1. After creating a request, use the dropdown to change the request type to POST.

    Set request type to POST

  2. Open the Bodytab and check the data type for raw.

    Setting data type to raw

  3. Open the Content-Type selection box that appears to the right and select either XML (application/xml)or XML (text/xml)

    Selecting content-type text/xml

  4. Enter your raw XML data into the input field below

    Example of XML request in Postman

  5. Click Sendto submit your XML Request to the specified server.

    Clicking the Send button

  1. 创建请求后,使用下拉列表将请求类型更改为POST

    将请求类型设置为 POST

  2. 打开Body选项卡并检查raw的数据类型。

    将数据类型设置为原始

  3. 打开出现在右侧的 Content-Type 选择框,然后选择XML (application/xml)XML (text/xml)

    选择内容类型 text/xml

  4. 在下面的输入字段中输入您的原始 XML 数据

    Postman 中的 XML 请求示例

  5. 单击发送将您的 XML 请求提交到指定的服务器。

    单击发送按钮