【问题标题】:Test complex WebApi method by using Fiddler or what ever extension使用 Fiddler 或任何扩展测试复杂的 WebApi 方法
【发布时间】:2015-08-14 15:04:52
【问题描述】:

您能告诉我如何使用fiddler 或任何扩展名来测试下面提到的复杂webapi 方法吗?提前致谢。

WebApi 方法:

 [HttpPost]
 [POST("Sponsors/MyFulfilled/{pledgeId}/{amount}")]
 public string MyFulfilled(int pledgeId, decimal amount, MyConfirmation mp)
        {
           //code here

            return "thanks";
        }

MyConfirmation 类:

 public class MyConfirmation
        {
            public string checkoutid { get; set; }
        }

更新:

我曾经这样使用过。但是它不起作用:(

pledgeId=5&amount=88&mp={
"checkoutid":"12"
}

【问题讨论】:

  • 需要 Fiddler 的任何具体原因? Chrome 有一个很好的扩展来测试 REST。 stackoverflow.com/questions/20591770/…
  • @lcryder 好的,没问题。但是我需要为post请求构造上述方法。所以你能告诉我怎么做吗?
  • SoapUI 有一些不错的实用工具soapui.org/rest-testing/getting-started.html
  • 我提供的链接显示了如何进行 POST...大致...pledgeId=5&amount=88&mp=yourJSONMyConfirmationString
  • @lcryder 它不起作用。请查看我的更新。

标签: asp.net-mvc google-chrome asp.net-web-api fiddler


【解决方案1】:

在 fiddler 中尝试以下配置:

问候,

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-27
    • 1970-01-01
    • 2013-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-19
    • 1970-01-01
    相关资源
    最近更新 更多