Thank you Dan, I replace spaces by %20 and it works now.

Regards
Olivier



2013/11/14 Dan Fandrich <d...@coneharvesters.com>

> 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="http://spotlight.dbpedia.org/rest/spot/?text=President 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
> http%3A%2F%2Fspotlight.dbpedia.org
> %2Frest%2Fspot%2F%3Ftext%3DPresident%20Obama%20called%20Wednesday%20on%20Congress%20to%20extend%20a%20tax%20break%26spotter%3DLingPipeSpotter
> 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: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html
>
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to