Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
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
Posted
Comments
Sergey Alexandrovich Kryukov 30-Jul-14 2:06am    
Not clear. Please elaborate, use "Improve question" above. What is "request from URL"? An HTTP request could be just from some IP address, not URL...
—SA

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900