我有一個簡單的python 3腳本,它發送一個post請求來刪除SonarQube中的一個項目。當我一直在我的python腳本中,一個簡單的curl命令工作...任何想法我的python腳本有什麼問題?Python Post - 繼續獲得響應400,但捲曲工程
import requests
headers = {
'Authorization': 'Basic YWRtaW46YWRtaW4=',
}
files = [
('key', 'com.eclipseoptions.viewserver:viewserver:feature_VS-313-add-an-instruction-event-and-view'),
]
r = requests.post('http://devsonar/api/projects/delete', headers=headers, files=files)
print(r)
下面的curl命令工作正常:
curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -F "key=com.eclipseoptions.viewserver:viewserver:feature_VS-313-add-an-instruction-event-and-view" "http://devsonar/api/projects/delete"