Skip to content

Commit cc06871

Browse files
committed
Adding some debug messages for future-self
1 parent 08d733c commit cc06871

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/utils/api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,14 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT):
696696
"""
697697
REST-JSON API client
698698
"""
699+
700+
dbgMsg = "Example client access from command line:"
701+
dbgMsg += "\n\t$ taskid=$(curl http://%s:%d/task/new 2>1 | grep -o -I '[a-f0-9]\{16\}') && echo $taskid" % (host, port)
702+
dbgMsg += "\n\t$ curl -H \"Content-Type: application/json\" -X POST -d '{\"url\": \"http://testphp.vulnweb.com/artists.php?artist=1\"}' http://%s:%d/scan/$taskid/start" % (host, port)
703+
dbgMsg += "\n\t$ curl http://%s:%d/scan/$taskid/data" % (host, port)
704+
dbgMsg += "\n\t$ curl http://%s:%d/scan/$taskid/log" % (host, port)
705+
logger.debug(dbgMsg)
706+
699707
addr = "http://%s:%d" % (host, port)
700708
logger.info("Starting REST-JSON API client to '%s'..." % addr)
701709

0 commit comments

Comments
 (0)