mirror of https://github.com/aliasrobotics/cai.git
add curl tool
This commit is contained in:
parent
d92d8519ef
commit
2ba488d1e4
|
|
@ -1,11 +1,13 @@
|
|||
from cai.tools.common import run_command
|
||||
"""
|
||||
Here are the curl tools.
|
||||
"""
|
||||
def curl(args: str, target: str, ctf=None) -> str:
|
||||
from cai.tools.common import run_command # pylint: disable=import-error
|
||||
|
||||
|
||||
def curl(args: str = "", target: str = "", ctf=None) -> str:
|
||||
"""
|
||||
A simple curl tool to make HTTP requests to a specified target.
|
||||
|
||||
|
||||
Args:
|
||||
args: Additional arguments to pass to the curl command
|
||||
target: The target URL to request
|
||||
|
|
@ -14,4 +16,4 @@ def curl(args: str, target: str, ctf=None) -> str:
|
|||
str: The output of running the curl command
|
||||
"""
|
||||
command = f'curl {args} {target}'
|
||||
return run_command(command, ctf=ctf)
|
||||
return run_command(command, ctf=ctf)
|
||||
|
|
|
|||
Loading…
Reference in New Issue