arch-ut Posted June 14, 2015 Report Share Posted June 14, 2015 G'day all, I'm having some difficulty getting the web api commands working correctly. I'm using cURL on my linux box and trying the following commands:curl -u username:password http://localhost:8080/gui/token.htmlThis produces and output of<html><div id='token' style='display:none;'>tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA</div></html>Now that appears to work fine, so I then send the next command:curl -u username:password http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA&action=setsetting&s=bind_port&v=10001'>http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA&action=setsetting&s=bind_port&v=10001results in...[1] 22209[2] 22210[3] 22211[admin@arch-ut ~]$invalid request[1] Done curl -u username:passwod http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA[2]-'>http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA[2]- Done action=setsetting[3]+ Done s=bind_port[admin@arch-ut ~]$I'm not really sure how to translate this result - because it doesn't seem to make any changes. I even tried:curl -u username:password http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA&list=1'>http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA&list=1which results in:[1] 22220[admin@arch-ut ~]$invalid request[1]+ Done curl -u username:password http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAAAm I sending the incorrect information? This is really bugging me as i'm trying to automate a script to change the bind_port every hour. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
BetterBill Posted September 8, 2015 Report Share Posted September 8, 2015 Sorry for the late response, you probably have figured it for now. In case you didn't, or if anyone get the same problem, it's easy to fix: just put quotes around the URL, like: curl -u username:password "http://localhost:8080/gui/?token=tpWpgWpgbXhSyTrCmTYX39utU4DcbLdnAAAAAMXBcJoAAAAAxi0BGp0tfVUAAAAA&action=setsetting&s=bind_port&v=10001" The problem happens because the URL contains &. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.