cURL / Mailing Lists / curl-library / Single Mail


Re: URL encoding in libcurl C++

From: Dan Fandrich <>
Date: Thu, 14 Nov 2013 20:44:52 +0100

On Thu, Nov 14, 2013 at 05:25:09PM +0100, Olivier Austina wrote:
> I try to use libcurl in C++ with the DBpedia Spotlight examples. this is the
> code following this example. But there is no result. I don't have an
> annotation.

> char *txt=" Obama called Wednesday on Congress to extend a tax break&spotter=LingPipeSpotter";
> char* data=curl_easy_escape(curl, txt,0);
> curl_easy_setopt(curl, CURLOPT_URL, data);

The curl_easy_escape function will escape the *entire* string, so you end
up with a string like
which isn't a URL at all. You should really check the return code of all these
functions to find out where libcurl doesn't like the input.

>>> Dan
List admin:
Received on 2013-11-14