| Author |
Message |
|
trekinsanity
Joined: Sep 11, 2004 Posts: 40
|
 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 |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
Could you post the real values you are using (well, do change the username and password)
|
| Thu Oct 29, 2009 10:25 pm |
|
 |
|
CharlieParker
Joined: Apr 10, 2006 Posts: 236 Location: Lower Hudson Valley
|
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 |
|
 |
|
CharlieParker
Joined: Apr 10, 2006 Posts: 236 Location: Lower Hudson Valley
|
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 |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11692 Location: Texas
|
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.
_________________
|
| Fri Oct 30, 2009 9:13 am |
|
 |
|
CharlieParker
Joined: Apr 10, 2006 Posts: 236 Location: Lower Hudson Valley
|
- 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 |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11692 Location: Texas
|
But does using '-X PUT' (not POST) work for you?
_________________
|
| Fri Oct 30, 2009 10:08 am |
|
 |
|
CharlieParker
Joined: Apr 10, 2006 Posts: 236 Location: Lower Hudson Valley
|
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 |
|
 |
|
trekinsanity
Joined: Sep 11, 2004 Posts: 40
|
Matt,
HOw do you exactly use the curl w/ the --digest? Can you give an example?
|
| Wed Nov 11, 2009 8:32 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11692 Location: Texas
|
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.
_________________
|
| Wed Nov 11, 2009 9:10 pm |
|
|