cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Can't get more complicated URLs to work

From: Tim Tessier <ttessier_at_swhistlesoft.com>
Date: Fri, 10 Dec 2010 12:34:46 -0500

From the curl manual

-d/--data <data>
              (HTTP) Sends the specified data in a POST request to the HTTP
              server, in the same way that a browser does when a user has
              filled in an HTML form and presses the submit button. This will
              cause curl to pass the data to the server using the content-type
              application/x-www-form-urlencoded. Compare to -F/--form.

              -d/--data is the same as --data-ascii. To post data purely
              binary, you should instead use the --data-binary option. To URL-
              encode the value of a form field you may use --data-urlencode.

              If any of these options is used more than once on the same com-
              mand line, the data pieces specified will be merged together
              with a separating &-symbol. Thus, using '-d name=daniel -d
              skill=lousy' would generate a post chunk that looks like
              'name=daniel&skill=lousy'.

Thanks,
Tim Tessier

http://www.swhistlesoft.com

On 2010-12-10, at 10:30 AM, Ocean wrote:

>
>
> I have what I am sure is a common question. If I'm trying to grab a
> web page's source in a temp file, I can do this perfectly fine as long as
> it's a simple URL, like "http://www.google.com".
>
> What I'm having problems with is how to make this work with a more
> complicated URL, where I'm trying to do this:
>
>
> cURL.exe -s -o "C:\Temp\cURL Temp.txt"
> "http://www.domain.com/find/provTestSearch.do?cityQuick=Los+Angeles&stateQui
> ck=CA&test_individual_Quick=lastN&groups=50&langpref=en&site_id=testfind&sea
> rch_cat=dall&geo1=city&sortOrder=ASC&provider_category_Quick=dcat&button_fla
> g=Q&secureStatus=Y&test_name_quick=test_prov&psid=null&sortBy=name&lastProvR
> ow=0
> "
>
>
> I've tried a few different methods of making this work, but I
> haven't succeeded yet. If I post that URL (in it's non-redacted form)
> directly into a browser, it works just fine.
>
> Can someone show me where my mistake is and how I can get this to
> work properly?
>
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-10