[curlpp:176] getting curlpp response headers

358 views
Skip to first unread message

Compy

unread,
May 2, 2010, 1:50:59 PM5/2/10
to curlpp
Hey,

I have a curlpp request object that im setting up such as:

myRequest.setOpt(new curlpp::options::UserAgent("User-Agent=Mozilla/
5.0 (X11; U; Linux i686; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6"));
myRequest.setOpt(new curlpp::options::WriteStream(&os));
myRequest.setOpt(new curlpp::options::Url(url));

After I perform the request, how can I get a custom header from the
response? I have a custom header such as RELAY-CHECK: MISS, and I have
no idea how I can get that, when I set verbose to true, even with the
writestream set it goes to STDOUT, but how can I grab that response
header?

--
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to cur...@googlegroups.com.
To unsubscribe from this group, send email to curlpp+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.

Moritz Lage

unread,
Jun 5, 2010, 2:34:50 PM6/5/10
to curlpp
Hi,
dont't know if you still need it.. a bit late. But perhaps someone
else is prevented from hours of research. You simply have to set this
option to prefix the header to the normal body output.

myRequest.setOpt(new curlpp::options::Header(true));


http://groups.google.com/group/curlpp/browse_thread/thread/f9b695ee4c682a23/50bbc06c3b3ef8dd?lnk=gst&q=header#50bbc06c3b3ef8dd

On 2 Mai, 19:50, Compy <ji...@catster.net> wrote:
> Hey,
>
> I have a curlpp request object that im setting up such as:
>
>                 myRequest.setOpt(new curlpp::options::UserAgent("User-Agent=Mozilla/
> 5.0 (X11; U; Linux i686; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6"));
>                 myRequest.setOpt(new curlpp::options::WriteStream(&os));
>                 myRequest.setOpt(new curlpp::options::Url(url));
>
> After I perform the request, how can I get a customheaderfrom the
> response? I have a customheadersuch as RELAY-CHECK: MISS, and I have
Reply all
Reply to author
Forward
0 new messages