Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Parsing HTTP Headers
I have a TCPListener which listens for traffic on a specific port. When
a request is made to the socket from a Web Browser I get the usuall
HTTP Headers you would expect, whats the best way to parse out those
HTTP Headers so I can get the GET and POST information. Is there a
class within C# that helps out with this? Or does someone have some
code out there I can use.

Thanks a lot.


Report this thread to moderator Post Follow-up to this message
Old Post
gingerninja1@gmail.com
04-13-05 08:58 PM


Re: Parsing HTTP Headers
Use split, but first check your line delimiter to figure out what to pass to
split.
Check CR/LF first for Windows, then Check for LF for Unix then check for CR.
I came across a system that uses CR but I forgot which one that was.

If a POST then check for a double delimiter cause that's what seperates your
HTTP Headers from your POST data.

You may want to read up on the HTTP Protocol as well. :)


<gingerninja1@gmail.com> wrote in message
news:1113411346.103190.269010@l41g2000cwc.googlegroups.com...
>I have a TCPListener which listens for traffic on a specific port. When
> a request is made to the socket from a Web Browser I get the usuall
> HTTP Headers you would expect, whats the best way to parse out those
> HTTP Headers so I can get the GET and POST information. Is there a
> class within C# that helps out with this? Or does someone have some
> code out there I can use.
>
> Thanks a lot.
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
gabe garza
05-15-05 12:13 AM


Re: Parsing HTTP Headers
Use split, but first check your line delimiter to figure out what to pass to
split.
Check CR/LF first for Windows, then Check for LF for Unix then check for CR.
I came across a system that uses CR but I forgot which one that was.

If a POST then check for a double delimiter cause that's what seperates your
HTTP Headers from your POST data.

You may want to read up on the HTTP Protocol as well. :)


<gingerninja1@gmail.com> wrote in message
news:1113411346.103190.269010@l41g2000cwc.googlegroups.com...
>I have a TCPListener which listens for traffic on a specific port. When
> a request is made to the socket from a Web Browser I get the usuall
> HTTP Headers you would expect, whats the best way to parse out those
> HTTP Headers so I can get the GET and POST information. Is there a
> class within C# that helps out with this? Or does someone have some
> code out there I can use.
>
> Thanks a lot.
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
gabe garza
05-18-05 09:00 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

C# archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:09 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.