Visual Basic 2010 HTTP POST请求 [英] Visual Basic 2010 HTTP POST Request
本文介绍了Visual Basic 2010 HTTP POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何向服务器发送POST HTTP请求(在Visual Basic 2010中),然后将回复接收到字符串中。
How can I send a POST HTTP request to a server (in Visual Basic 2010) and then receive the reply into a string.
推荐答案
您可以通过HttpWebRequest执行此操作。只需将 HttpWebRequest.Method 设置为POST 。
You can do this via HttpWebRequest. Just set the HttpWebRequest.Method to "POST".
有关详细信息,请参阅MSDN页面上的示例 HttpWebRequest.Method 。对 GetReponse 的调用将返回WebReponse,包括一个流。然后,您可以使用StreamReader从Stream中读取字符串信息。
For details, see the example on the MSDN page for HttpWebRequest.Method. The call to GetReponse will return a WebReponse which includes a Stream. You can then read the string information from the Stream using a StreamReader.
这篇关于Visual Basic 2010 HTTP POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文