Re: do shell script curl where url must contain double quotes
Re: do shell script curl where url must contain double quotes
- Subject: Re: do shell script curl where url must contain double quotes
- From: Walter Ian Kaye <email@hidden>
- Date: Tue, 30 Mar 2004 15:46:31 -0800
At 03:17p -0700 03/30/2004, Gnarlodious didst inscribe upon an electronic papyrus:
>
Entity Jeffrey H. Dean spoke thus:
>
>
> Is it possible to use curl --url with a url that must contain double
>
> quotes? Escaping the quotes as below gives a parameter error from the
>
> server. I have also tried other types of quotes without success.
>
>
>
> Thanks,
>
> Jeff
>
>
>
> set theSource to do shell script "curl --url
>
> 'testing.shippingapis.com/ShippingAPITest.dll?API=TrackV2&XML=
>
> <TrackFieldRequest USERID=\"1111\" PASSWORD=\"2222\"> <TrackID
>
> ID=\"EO001607035US\"/> </TrackFieldRequest>'"
>
>
Try replacing them with " (you might need to escape the & character)
" is an HTML entity and is only for use inside HTML pages -- nowhere else.
What you want is URL encoding -- and for the spaces as well:
set theSource to do shell script "curl --url 'testing.shippingapis.com/ShippingAPITest.dll?API=TrackV2&XML=<TrackFieldRequest USERID="1111" PASSWORD="2222"><TrackID ID="EO001607035US"/></TrackFieldRequest>'"
You might need to encode the equal signs inside the XML as = also, depending on how that DLL does its parsing of the URL.
-W
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.