cURL / Mailing Lists / curl-users / Single Mail

curl-users

Curl command line option wont work for escaping url parsing

From: Sharma, Amit <asharma5_at_lehman.com>
Date: Mon, 27 Nov 2006 17:10:18 -0500

hi All,
I am tried a few combinations to the URL using curl command line tool
and am not able to get through.
Appreciate any help in this regard.

I am trying to fetch some data from a URL of the form:
http://example.com/get/demo/product.do?search=GetHoliday&Month=December&
result=xml

When I use the browser, I am able to successfully pull the result from
the remote site.
However, when I use Curl command line, the curl tool truncates the url
to
http://example.com/get?demo/product.do?search=GetHoliday

So basically everything after & is ignored by the curl command line
tool.

When I url encode the path (changing & to %26 ) :
http://example.com/get?demo/product.do?search=GetHoliday%26Month=Decembe
r%26result=xml
and use it in the curl command line, I can see the url not getting
truncated. However,
I get an error back from the server indicating that %26 is unrecognized.

So maybe the webserver accepts the request without url encoding and is
not performing a URL decoding.

Is there a way in curl command line tool to escape url parsing. I tried
the -g option but it wont work.

I can see a library function of curl_easy_escape(). Wondering if we have
the same option in command line.
Also, any specific reason why the remote server wont accept the encoded
URL. My understanding was that
Url encoding is part of the standard for webservers.

Gracias,
Amit

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.

--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.
Received on 2006-11-27