Hi Friends,
I have to trap IIS requests and then have to modify it and then have to send it again.
Can you tell me how can i do this using iHttpmodule and iHttpHandler ?
Can you tell me using which property of "Request" object, can i get those XML desctiption of IIS request ?
I mean when IIS gets a request, it gets in XML format, I want to read this whole request, want to modify it and want to send it back.
Please provide me some sample source code for the same.
You can use an HTTP module to monitor all requests to your web application. You need to impliment IHttpModule on your handler class. If you override the Application_BeginRequest() method I think you will be able to create a new request based on the original
with the HTTP headers modified as you require. I'm not sure what you mean about the XML that IIS receives, but maybe you are just interested in the HTTP headers collection in the request object.
Here is a tutorial on creating an HTTP module:
http://msdn.microsoft.com/en-us/library/ms227673.aspx
Ya, i have tried with HTTPModule and i can trap request going to IIS. I think now i would like to describe my actual senario what i have to do.
I have mapped one folder as Web Folder named "Nirav". There are some sub folders and files under this folder. Now i have mapped this web folder as my network drive using the option "Connect to a Network Server". So that after connecting to this
http://ComputerName/Nirav user will be able to move files within his window explorer itself.
For this, i think first of all i will have to catch IIS request and then will have to modify it like "TestSubFolder" instead of "NiravSubFolder". I am not sure how to do this.
Also, about trapping IIS request, when i browse through Internet Explorer, i can trap it, but is it possible to trap IIS request while Accessing this Web Folder as a Network Drive through Window Explorer ?
Member
44 Points
403 Posts
How to change IIS request elements ?
May 25, 2006 05:26 PM|niravparekh|LINK
Hi Friends,
I have to trap IIS requests and then have to modify it and then have to send it again.
Can you tell me how can i do this using iHttpmodule and iHttpHandler ?
Can you tell me using which property of "Request" object, can i get those XML desctiption of IIS request ?
I mean when IIS gets a request, it gets in XML format, I want to read this whole request, want to modify it and want to send it back.
Please provide me some sample source code for the same.
thanks in advance
nirav parekh
Member
10 Points
39 Posts
Re: How to change IIS request elements ?
May 28, 2006 12:36 PM|geedubb|LINK
You can use an HTTP module to monitor all requests to your web application. You need to impliment IHttpModule on your handler class. If you override the Application_BeginRequest() method I think you will be able to create a new request based on the original with the HTTP headers modified as you require. I'm not sure what you mean about the XML that IIS receives, but maybe you are just interested in the HTTP headers collection in the request object.
Here is a tutorial on creating an HTTP module:
http://msdn.microsoft.com/en-us/library/ms227673.aspx
HTH
Member
44 Points
403 Posts
Re: How to change IIS request elements ?
May 30, 2006 11:11 AM|niravparekh|LINK
Hi Friend,
Ya, i have tried with HTTPModule and i can trap request going to IIS. I think now i would like to describe my actual senario what i have to do.
I have mapped one folder as Web Folder named "Nirav". There are some sub folders and files under this folder. Now i have mapped this web folder as my network drive using the option "Connect to a Network Server". So that after connecting to this http://ComputerName/Nirav user will be able to move files within his window explorer itself.
Now when user access http://ComputerName/Nirav/NiravSubfolder/test.txt , i want to show this URL as http://ComputerName/Nirav/TestSubFolder/test.txt, I mean by changing subfolder name so that use assumes that he is working under "TestSubfolder", though he is actually working under "NiravSubFolder".
For this, i think first of all i will have to catch IIS request and then will have to modify it like "TestSubFolder" instead of "NiravSubFolder". I am not sure how to do this.
Also, about trapping IIS request, when i browse through Internet Explorer, i can trap it, but is it possible to trap IIS request while Accessing this Web Folder as a Network Drive through Window Explorer ?
Can you give me some sample codes for the same ?
Thanks,
Nirav