cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multi Interface - How to know the URL for which request is completed

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Thu, 21 May 2009 20:10:41 -0500

On May 21, 2009, puneet sharma wrote:

> I am trying to use libcurl via multi interface. I am able to implement the
> handling till the point where i come to know that one of my requests is
> complete (via curl_multi_info_read).

> I get the easy_handle for the request. However, i want to know the URL which
> was set for the handle. Is there a way to do that ?

If you want to know the URL that libcurl finally ended up at,
(after any redirects) you can use curl_easy_getinfo() with the
CURLINFO_EFFECTIVE_URL option. If you actually need to know
the original URL that you passed to libcurl, you can associate
that information with the easy handle using curl_easy_setopt()
with CURLOPT_PRIVATE, and then retrieve the pointer later
with curl_easy_getinfo() and CURLINFO_PRIVATE.

 - Jeff
Received on 2009-05-22