Answers for "install python with curl"

0

curl install pip

#First download the pip installer with curl
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
#Then execute the pip installer
python get-pip.py
Posted by: Guest on March-22-2021
1

python run curl

import shlex
cmd = '''curl -X POST -d  '{"nw_src": "10.0.0.1/32", "nw_dst": "10.0.0.2/32", "nw_proto": "ICMP", "actions": "ALLOW", "priority": "10"}' http://localhost:8080/firewall/rules/0000000000000001'''
args = shlex.split(cmd)
process = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
Posted by: Guest on June-26-2020
1

python run curl

url     = 'http://example.tld'
payload = { 'key' : 'val' }
headers = {}
res = requests.post(url, data=payload, headers=headers)
Posted by: Guest on June-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language