Parsing a http response

N

nick.spacek

Hi everyone,
I'm using some packet sniffing code to grab HTTP packets, and I want to
turn the packets into a (preferably) HttpWebResponse. Is there any
way to do this, or am I going to have to write my own class to do this?

Thanks,
Nick
 
G

Guest

Nick,
an HttpWebResponse instance is normally created as the result of an
HttpWebRequest instance having it's Create method called, and then the
GetResponse method ,e.g.
HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse();

I'm just wondering why you would need to attempt to reconstruct all this out
from a packet sniffer when you can just make the request programatically?

Peter
 
N

nick.spacek

The goal is to be intercepting incoming HTTP packets only and checking
their content against a filter. I probably haven't investigated well
enough yet - I'm not sure if it's possible for me to rewrite the
packets or just see what the contents are. The idea is that this will
be a system service that is sitting there watching.

Nick
 
G

Guest

OK then.
There is an article on codeproject.com with code to use C# to wrap WinPCap,
and apply filters. This may be helpful to you.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top