[英]Send HTTP request from VC++ file
I am trying to send an HTTP request with the contents of a file set as the body of the HTTP request and want to get the response from a server using VC++. 我正在尝试发送一个HTTP请求,并将文件内容设置为HTTP请求的主体,并希望使用VC ++从服务器获取响应。
Any help is appreciated. 任何帮助表示赞赏。 Thanks. 谢谢。
I think I was not very clear with what I wanted to do or I misunderstood the answers. 我想我不太清楚自己想做什么,或者我误解了答案。 Neways, what I want to accomplish is, one of my web-services accepts the data of a local file as the body of the HTTP request sent to it. 总而言之,我要完成的工作是,我的一个Web服务将本地文件的数据作为发送给它的HTTP请求的主体。 I want to make a call to this service and send the contents of a txt file as the body of the HTTP request. 我想对此服务进行调用,并将txt文件的内容作为HTTP请求的正文发送。 In return I will get a response from the service which I want to get in a string variable. 作为回报,我将从服务中获得想要返回字符串变量的响应。
Thanks. 谢谢。
You can use cURL library . 您可以使用cURL库 。 There is also a similar topic Programmatically reading a web page 还有一个类似的主题,以编程方式阅读网页
You can always use WinInet. 您可以随时使用WinInet。 Check out the docs here: 在这里查看文档:
http://msdn.microsoft.com/en-us/library/aa385331(VS.85).aspx http://msdn.microsoft.com/en-us/library/aa385331(VS.85).aspx
HTH HTH
Colby Africa 非洲科尔比
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.