curl
#get
curl http://address:port/url?args
#post
curl http://address:port/url -d "param1=value1¶m2=value2"
#上传文件
curl http://address:port/url -F "[email protected]"
python
import requests
FILE_NAME = '111.jpg'
FILE_PATH = FILE_NAME
url = "http://address:port/url"
with open(FILE_PATH, 'rb') as fb:
files = {'file': (FILE_NAME, fb, 'application/jpeg')}
response = requests.post(url, files=files)
print(response.text)