如何发送包含消息的简单http请求c ++ [英] how to send simple http request c++ which contain message in it

查看:159
本文介绍了如何发送包含消息的简单http请求c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将简单的http请求发送到我的localhost:8080 / program1.jsp。请求应包含一条消息,如Hello server this is Request,如何使用vc ++?

I want to send simple http request to my localhost:8080/program1.jsp. request should contain a message like "Hello server this is Request" how with vc++ it is possible?

推荐答案

请参阅我对该问题的评论。它没有意义,因为没有这样的东西。你不能简单地发送一些任意请求;它的内容应该取决于接收请求的页面定义的元数据。此外,它可能支持也可能不支持一个或另一个HTTP请求方法。您所做的只是符合Web页面的服务器端(Web应用程序,Web服务)。有关详细信息,请参阅: http://en.wikipedia.org/wiki/HTTP [ ^ ]。



To实现HTTP请求,为C ++使用一些合适的网络库。首先,我建议你看看这个: http://cpp-netlib.org/0.9.2 [ ^ ]。



-SA
Please see my comment to the question. It does not really make sense, because there is no such thing. You cannot simply send some arbitrary request; it content should depend on the metadata defined by the page receiving the request. Besides, it may or may not support one or another HTTP request method. All you do should be in compliance with the server side of your Web page (Web application, Web service). For further detail, please see: http://en.wikipedia.org/wiki/HTTP[^].

To implement HTTP request, use some suitable network library for C++. First of all, I would recommend to look at this one: http://cpp-netlib.org/0.9.2[^].

—SA


这篇关于如何发送包含消息的简单http请求c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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