具有ajax请求的POST Web服务的IO DOCS配置

时间:2014-06-04 19:13:01

标签: ajax json post iodocs

我想在I / O DOC中作为请求主体的一部分在JSON字符串下面发布。

{ “名称”: “ABCD”, “别名”: “PS”, “日期”: “20140604”, “状态”: “新”, “PdfPath”: “/文件夹1 / app.pdf”} < / p>

端点的配置是什么? 我正在使用以下端点配置,但它无法正常工作。

{
  "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."
          }
        ]

      }
    ]
  }
]
}

1 个答案:

答案 0 :(得分:0)

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

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

我认为这可以解决你的问题