![](/img/trans.png)
[英]Using fiddler to test my WEB Api . Which content type to select and the input parameter is always null
[英]Web API Test using Fiddler return null
當我使用提琴手測試以下API時,請始終將參數myRequest設置為空值。 我該如何解決?
API
public HttpResponseMessage Post([FromBody]MyRequest myRequest)
{
}
模型
public class MyRequest
{
public int[] MyId { get; set; }
}
提琴手測試
http://localhost:4037/api/PostTest
請求正文
{
"MyRequest": {
"MyId": [
1,
2
]
}
}
您不需要JSON中的“ MyRequest” ...
{
"MyId": [
1,
2
]
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.