在VB.NET中将正文内容添加到httpwebrequest [英] Add body content to httpwebrequest in VB.NET

查看:249
本文介绍了在VB.NET中将正文内容添加到httpwebrequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要对RESTful Web服务进行PUT调用。该调用包括用于指定要返回的项的正文内容。 Body未在属性列表中明确定义。如何添加到对象?



我尝试过:



Postman,用于验证调用的语法和结构。

I need to make a PUT call to a RESTful web service. The call include body content to specify the item to be returned. Body is not explicitly defined in the list of properties. How is it added to the object?

What I have tried:

Postman, to validate syntax and structure of call.

推荐答案

如果您使用Postman测试Web API那么这与VB.NET本身无关,您可以直接从Postman界面配置它们。为每种请求类型提供请求正文,并在您用于执行所有操作的同一面板或选项卡中提供。



请参阅此链接以了解如何向请求添加请求正文,https://learning.getpostman.com/docs/postman/sending_api_requests/requests/#request-body [ ^ ],您还可以指定要发送的请求体类型,JSON,XML ,或二进制内容。



如果您的意思是想要接受基于VB.NET的Web API中的数据,那么请检查如何从 HttpClient的 [<一个href =https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?redirectedfrom=MSDN&view=netframework-4.7.2\"target =_ blanktitle =New窗口> ^ ]对象(或服务器f的类型)你正在使用的ramework)。
If you are using Postman to test the Web API then that has nothing to do with VB.NET itself, and you can configure them right from the Postman interface. Request body is provided for every request type, and in the same panel or tab that you are using to perform all the actions.

See this link to learn how to add request body to a request, https://learning.getpostman.com/docs/postman/sending_api_requests/requests/#request-body[^], you can also specify the kinds of request body you want to send, JSON, XML, or binary content.

If you mean you want to accept the data in VB.NET based Web API, then please check how to read the data from the HttpClient[^] object (or the type of the server framework you are using).


这篇关于在VB.NET中将正文内容添加到httpwebrequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆