简体   繁体   English

Visual Studio:具有针对复杂类型的WebAPI pos主体的Web性能测试

[英]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.

相关问题 如何在Visual Studio Web性能测试中从依赖的WebTestRequests获取响应主体 - How to get response bodies from dependent WebTestRequests in a Visual Studio Web Performance Test 是否可以将Visual Studio的Web性能测试用作Web服务器场的压力测试? - Can Visual Studio's Web Performance Test be used as a stress test for a web farm? 如何在Visual Studio 2012中将编码的Web性能测试添加到负载测试 - how to add coded Web performance test to a load test in visual studio 2012 如何将值列表作为参数传递给Visual Studio Web性能测试或加载测试插件? - How can I pass a list of values as a parameter to a Visual Studio web performance test or load test plugin? 使用 WebApi 客户端发布复杂类型 - Posting complex types with WebApi Client Microsoft Visual Studio Web性能测试记录器可以将文件从Internet Explorer保存到本地磁盘吗? - Can Microsoft Visual Studio Web Performance Test Recorder save file from the Internet Explorer to local disk? 可以在带有jquery对话框的页面上使用Visual Studio 2010 Web性能测试吗? - Possible to use Visual Studio 2010 web performance test on page with jquery dialog? 使用Visual Studio 2017负载测试来测试具有不同请求主体的其余API - Using Visual Studio 2017 Load Testing to test rest API with different request bodies Visual Studio Web性能测试-OAuth 2.0 - Visual studio Web Performance tests - OAuth 2.0 了解Visual Studio Web应用程序中的项目类型 - Understanding project types in a Visual Studio web application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM