cURL / Mailing Lists / curl-library / Single Mail

curl-library

How to use curl_easy_escape on a URL

From: <centrio_at_gmail.com>
Date: Tue, 19 May 2009 13:19:52 +0000

Hi,
I want to use char *curl_easy_escape( CURL * curl , char * url , int length
); API to convert
a URL "http://64.128.66.86/test data.xlx" into something
like "http://64.128.66.86/test%20data.xlx".
Libcurl provides this api but I cannot get the exact result I am expecting.

char* url = "http://64.128.66.86/test data.xlx";
int length = 0;
char *ch;
ch = (char*)curl_easy_escape(sessionData->curlEasyHandle, url, 8);
curl_easy_setopt(sessionData->curlEasyHandle, CURLOPT_URL, ch );
curl_free(ch);

the value of ch is "http%3A%2F%2F64%2E128%2E66%2E86%2Ftest%20data%2Exlx"

Am i making some mistake in using this api??

Thanks
Shivanand
Received on 2009-05-19