I have created a simple webservice and I am now in the testing mode. I am trying to write a simple script that will use curl to create user accounts and another one to delete user accounts.
I have tried to use system to send curl commands
my $cmd = "c:\\curl\\curl -X PUT -d \"user[email]=email$_\" " + "-d \"user[password]=pass$_\" " + "http://localhost:3000/site/users/user$_"; print "create user failed\n" if system($cmd);
I've also tried using backtick
$userResponses[$_] = `c:\\curl\\curl -u user$_ -X DELETE http://localhost:3000/site/users/user$_`;
BTW, I have been using curl to manually test the service because it supports all of the HTTP methods instead of just GET and POST.
Anyway, the problem I am running into is that I can't figure out a way to interact with curl to provide the required password after sending a command that requires authorization. Is there a way to do this?
Any help would be greatly appreciated. I am open to suggestions, including ones that that don't depend on curl.