View unanswered posts | View active topics It is currently Wed May 22, 2013 2:21 pm



Reply to topic  [ 10 posts ] 
 CURL 
Author Message

Joined: Sep 11, 2004
Posts: 40
Post CURL
I am trying to use curl to change an Indigo variable, called test. However, I keep getting "access denied." (FYI: I am using the correct login info.)

The format I am using is:

curl -u username:password -X PUT -d value=[hi] http://127.0.0.1:port/variables/test

Any ideas?


Thu Oct 29, 2009 9:56 pm
Profile
Online
User avatar

Joined: Nov 18, 2008
Posts: 1721
Location: Berkeley, CA
Post 
url -u username:password -X PUT -d value=[hi] http://127.0.0.1:port/variables/test
Could you post the real values you are using (well, do change the username and password)


Thu Oct 29, 2009 10:25 pm
Profile
User avatar

Joined: Apr 10, 2006
Posts: 236
Location: Lower Hudson Valley
Post 
First, try turning off authentication for testing. Second you're missing some hidden arguments. This works for me
Code: Select all
curl -d 'value="what ever"&_method=put&_onlyChanges=1&_blockUntilIdle=1' http://10.1.2.3:8176/variables/test

With out the hidden args I get a "405 Method Not Allowed". What exactly do you get?

(-X POST is implied with -d)


Fri Oct 30, 2009 8:02 am
Profile
User avatar

Joined: Apr 10, 2006
Posts: 236
Location: Lower Hudson Valley
Post 
I was going to delete my test variable and saw the quotes around what ever getting into Indigo.
Code: Select all
curl -d "value=what ever&_method=put&_onlyChanges=1&_blockUntilIdle=1" http://10.1.2.3:8176/variables/test

works fine.


Fri Oct 30, 2009 9:05 am
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11692
Location: Texas
Post 
FYI, you should be able to drop those hidden variables if you tell curl to use PUT (like Trek's example):
Code: Select all
curl -x PUT -d "value=what ever" http://10.1.2.3:8176/variables/test

Regarding the authentication failure, try passing curl the --digest option. Indigo requires the more secure HTTP Digest (not Basic) authentication.

_________________
Image


Fri Oct 30, 2009 9:13 am
Profile WWW
User avatar

Joined: Apr 10, 2006
Posts: 236
Location: Lower Hudson Valley
Post 
Code: Select all
curl -d "value=zwhat ever&_method=put" http://10.1.2.3:8176/variables/test

Works for me. But
Code: Select all
curl -X POST -d "value=zwhat ever" http://10.1.2.3:8176/variables/test

Gives a 405 Method Not Allowed

In any case, I wasn't aware this existed, cool, thanks. I've got to look at the built in web server again.


Fri Oct 30, 2009 10:05 am
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11692
Location: Texas
Post 
But does using '-X PUT' (not POST) work for you?

_________________
Image


Fri Oct 30, 2009 10:08 am
Profile WWW
User avatar

Joined: Apr 10, 2006
Posts: 236
Location: Lower Hudson Valley
Post 
PUT works, sorry I have currently have project where curl posting is an issue. Basically disregard everything I've said.


Fri Oct 30, 2009 10:51 am
Profile

Joined: Sep 11, 2004
Posts: 40
Post 
Matt,

HOw do you exactly use the curl w/ the --digest? Can you give an example?


Wed Nov 11, 2009 8:32 pm
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11692
Location: Texas
Post 
I've never tried it before, but based on the man page, I would think you would just add --digest as a command line argument to your example in the top post on this thread.

_________________
Image


Wed Nov 11, 2009 9:10 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.