Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > curl command instead of wget

curl command instead of wget
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Reply With Quote
Oct 20, 2008, 10:29 AM
 
Hi

I got this wget command:
"wget -q -O /dev/null --http-user=userid --http-password=psw --post-data="powerAction=1" http://10.0.1.180/cgi/power/powerHandler.cgi"

Can anyone translate that to curl - I am a newbie so sorry if this is obvious.

Cheers
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 20, 2008, 11:11 AM
 
Wouldn't it be easier to just install wget or modify the CGI to accept command line input?
     
bowie  (op)
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Reply With Quote
Oct 20, 2008, 11:24 AM
 
no, since wget won't run on my mac (have tried - but it will not work executing as a script from my automator. Why? I do not know). Curl is preinstalled and should be able to do the same thing.
Cant change the CGI since they are on my nas
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 20, 2008, 11:31 AM
 
wget does work on the Mac, what gave you the impression that it doesn't? What error message do you get invoking wget?

It looks like --basic, --data (or -d), and --user (or -u) are the options you need to post data, and authenticate via Apache basic authentication, according to curl's manpage.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Oct 20, 2008, 12:56 PM
 
Hmm, lessee... try this.

curl -u userid:psw -d "powerAction=1" -o /dev/null http://10.0.1.180/cgi/power/powerHandler.cgi

Warning: written in Safari, not tested.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
bowie  (op)
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Reply With Quote
Oct 21, 2008, 12:00 AM
 
Thx CharlesS that did the job
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:41 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2