Hi Daniel- I used the below, but it is now returning both Header and the Body (Since I set the CURLOPT_HEADER). curl_easy_setopt(m_pCurl, CURLOPT_WRITEFUNCTION, callback)
I know CURLOPT_HEADERFUNCTION will get me the headers, but how can I only get the Body? I don't want to make 2 calls. Thanks, Kal -----Original Message----- From: curl-library [mailto:[email protected]] On Behalf Of Daniel Stenberg Sent: Thursday, October 24, 2013 4:42 PM To: libcurl development Subject: Re: getting CURL parse the body On Thu, 24 Oct 2013, Sivasamy, Kalidoss wrote: > I am able to get the headers with the option below and parse the > headers fine. curl_easy_setopt(m_pCurl, CURLOPT_HEADER, 1); > > But how can I parse header and body from the same stream? I tried to > go one line after the HTTP headers, it doesn't see to work. Any ideas > or a link to a similar discussion? Why make it so hard for yourself? libcurl already separates the headers from the body for you, if you just made use of the separate callbacks. But if you insist, you can indeed find the first header with nothing but a CRLF or LF and use that as an end of headers marker. Unless you get more headers due to authenticaion, redirects, CONNECT responses etc. -- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html ________________________________ CONFIDENTIALITY AND SECURITY NOTICE The contents of this message and any attachments may be confidential and proprietary. If you are not an intended recipient, please inform the sender of the transmission error and delete this message immediately without reading, distributing or copying the contents.
------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
