【问题标题】:IODOCS configuration for POST webservices with ajax request带有 ajax 请求的 POST Web 服务的 IODOCS 配置
【发布时间】:2014-06-04 19:13:00
【问题描述】:

我想在 I/O DOC 中作为请求正文的一部分在 JSON 字符串下方进行 POST。

{"名称":"ABCD","别名":"PS","日期":"20140604","状态":"新建","PdfPath":"/folder1/app.pdf"}

端点的配置是什么? 我正在使用以下端点配置,但它不起作用。

{
  "endpoints": [
  {
    "name": "Information",
    "methods": [
      {
        "MethodName":"Add Product",
        "Synopsis": "Used to add Product for TEST purpose. This service is called internally, hence this helppage serves as a mockup for the internal call",
        "HTTPMethod":"POST",
        "URI":"/ServiceHost/test.svc/add-testService",
        "RequiresOAuth":"N",
        "parameters":[

          {
            "Name":"Name",
            "Default":"A",
            "Type":"enumerated",
            "EnumeratedList": ["A","B","C"],
            "DefaultValue":"N/A",
            "IsMandatory":"Yes",

            "Description":"This refers to the name."
          },

          {
            "Name":"Alias",

            "Default":"AB",

            "Type":"string",
            "DefaultValue":"N/A",
            "IsMandatory":"Yes",

            "Description":"This refers to the code."
          },

          {
            "Name":"Date",

            "Default":"",

            "Type":"string",
            "DefaultValue":"N/A",
            "IsMandatory":"Yes",

            "Description":"This refers to the date."
          },
          {
            "Name":"Status",
            "Default":"",

            "Type":"string",

            "DefaultValue":"New",
            "IsMandatory":"No",

            "Description":"This refers to the status."
          },

          {
            "Name":"PdfPath",
            "Default":"",

            "Type":"string",
            "DefaultValue":"Empty String",
            "IsMandatory":"No",

            "Description":"This refers to the full pdf path."
          }
        ]

      }
    ]
  }
]
}

【问题讨论】:

    标签: ajax json post iodocs


    【解决方案1】:

    您需要将 Type 用作 textarea。这将创建请求正文,您可以在其中发布您的输入。更具体地说,您可以提及您将使用 content-type 参数发布的输入类型。

        "contentType": "application/xml",
        "type": "textarea",
    

    我认为这会解决你的问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-14
      • 2013-04-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多