Go Back   UNIX Socket FAQ > Languages > C

Reply
 
Thread Tools Display Modes
  #1  
Old 02-05-2010, 03:45 PM
flashback_007 flashback_007 is offline
 
Join Date: Nov 2009
Posts: 11
Exclamation httpget_skip_the_header

hi all

i have just compiled my own httpget in c & works without any errors
&
i just want to now if there is a trick to skip downloaded files head like..

------------------
HTTP/1.1 200 OK
Connection: close
Date: Fri, 05 Feb 2010 16:28:22 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 13
Content-Type: text/html
Set-Cookie: ASPSESSIONIDQCBBSBTR=FGHALDOBACMGPOPCDHHOKNBF; path=/
Cache-control: private
--------------------

How do i skip the Head bit of the incoming data?

i can do it with my own cut_header() function but thats two proccess & instead of me skiping the header while downloading can do the trick & how can i detect the incoming header files end & write the actual incoming data by skipping the header to a file?


any one?
Reply With Quote
  #2  
Old 02-05-2010, 07:26 PM
RobSeace RobSeace is offline
Administrator
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 3,382
Default

If you're going to be talking and parsing HTTP, you really should read the HTTP specs...

But, basically, just look for a blank line... The headers all precede the blank line, and
the body (if any) follows it...
Reply With Quote
  #3  
Old 02-06-2010, 02:40 PM
flashback_007 flashback_007 is offline
 
Join Date: Nov 2009
Posts: 11
Default

thank you RobSeace
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:20 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.