[英]Visual Studio: Web Performance Test with WebAPI pos bodies for complex types
I've built a WebAPI endpoint that looks like: 我建立了一个WebAPI端点,看起来像:
[HttpPost]
public QueryResultSet PostFetchResults(QueryRequest request)
{
// Does some stuff
}
I have a Web Performance Test (the VS framework), and want to know how to create the proper post request for this endpoint. 我有一个Web性能测试(VS框架),并且想知道如何为该端点创建正确的发布请求。 When I create a Form Post Field I'm obviously forced to add a parameter name; 创建表单发布字段时,我显然被迫添加参数名称; however, as I understand it WebAPI simply applies a media-formatter to the post body to acquire the allowed FromBody parameter. 但是,据我了解,WebAPI只是将媒体格式程序应用于帖子正文以获取允许的FromBody参数。
Which option should I be choosing to make this work for me? 我应该选择哪个选项为我工作? Is this something I'll have to code up? 这是我必须编写的东西吗?
Let me know if you need more details. 让我知道您是否需要更多详细信息。
So I ended up needing to code my own plug-in for this. 因此,我最终需要为此编写自己的插件。 Thankfully, Microsoft already did my work for me: https://msdn.microsoft.com/en-us/library/ff458708.aspx 值得庆幸的是,微软已经为我完成了工作: https : //msdn.microsoft.com/zh-cn/library/ff458708.aspx
This will only work for web requests, but presumably that's all you would need for interacting with WebAPI. 这仅适用于Web请求,但大概就是与WebAPI交互所需的全部。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.