I am using the following code to upload a sample file to nexus repository. I found this on one of the answers
import requests
from requests.auth import HTTPBasicAuth
url ='https://localhost:8081/nexus/service/rest/v1/components'
params = (
('repository', 'tools'),
)
payload = {
'maven2.groupId': (None, 'com.example'),
'maven2.artifactId': (None, 'test-app'),
'maven2.version': (None, '1.0.4'),
'maven2.asset1': ('example.json', open('example.json', 'rb')),
'maven2.asset1.extension': (None, 'json'),
}
try:
response = requests.post(url,
params=params,
files=payload
)
response.raise_for_status()
except requests.exceptions.HTTPError as errh:
print("Http Error:", errh)
exit(1)
except requests.exceptions.ConnectionError as errc:
print("Error Connecting:", errc)
exit(1)
except requests.exceptions.Timeout as errt:
print("Timeout Error:", errt)
exit(1)
except requests.exceptions.RequestException as err:
print("OOps: Something Else", err)
exit(1)
I would like to know what is the speciality of None
in the line 'maven2.groupId': (None, 'com.example')
Please excuse me if this question does not fit here. But could you clarify