检查url的请求,并使用xml将响应数据发送到该URL [英] check the request of url and send response data to that url using xml

查看:91
本文介绍了检查url的请求,并使用xml将响应数据发送到该URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我使用的是VS2008,asp.net,xml。

我有一个网络应用程序。

我想从url中识别请求并根据请求(xml),我需要将数据作为xml发送到该URL。

如何执行此操作,

提前致谢

george

Dear Friends,

I am using VS2008,asp.net,xml.
I have a web application.
I want to identify the request from url and based on the request(xml) ,I need to send the data as xml to that url.
How to do this,
Thanks in advance
george

推荐答案

请求不清楚,似乎没有多大意义。原因如下:没有来自URL的请求这样的事情。一般情况下,您根本没有可以发送任何内容的URL;它假设有一个主机暴露给Web并运行一些支持标准Web协议的服务,例如HTTP,FTP等。通常,请求来自主机和软件(例如,最典型的,Web浏览器),没有这样的东西。



你可以得到一些用户发送你是来自该类实例的HTTP请求,不要太令人惊讶, System.Web.HttpRequest

http://msdn.microsoft.com/en-us/library/system.web。 httprequest%28v = vs.110%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer(v=vs.110)。 aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.web.httprequest。 useragent(v = vs.110).aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.web.httprequest.userhostaddress(v=vs.110)。 aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.web.httprequest.userhostname(v = vs.110).aspx [ ^ ]。



请注意,即使提供了主机地址,也不意味着您可以使用那个地址。 :-)



-SA
The request is not clear and does not seem to makes much sense. Here is why: there is no such thing as "request from URL". In general case, you simply don't have the "URL" to which you can send anything; it assumes that there is a host exposed to Web and running some service supporting one of the standard Web protocols, such as HTTP, FTP, and the like. Normally, the request comes from the host and software (for example, most typical, a Web browser) where there is no such thing.

You can get some user sending you an HTTP request from the instance of the class, not too surprisingly, System.Web.HttpRequest:
http://msdn.microsoft.com/en-us/library/system.web.httprequest%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.httprequest.useragent(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.httprequest.userhostaddress(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.httprequest.userhostname(v=vs.110).aspx[^].

Note that even, for example, the host address is provided, it does not mean that you can send your request using that address. :-)

—SA


这篇关于检查url的请求,并使用xml将响应数据发送到该URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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