Hi, I am trying to add a new component to an existing project using the REST API and the requests python library. When I tried running the below code, I get a 400 error that says
"{"errorMessages":["Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN\n at [Source: org.apache.catalina.connector.CoyoteInputStream@354be5ec; line: 1, column: 6]"]}"
Can someone give me some ideas as to what the mistake is? Thanks
auth = requests.auth.HTTPBasicAuth('user', 'password')
url = jira url
params = {
"name": "Test",
"description": "this is a component",
"leadUserName": "mhuh",
"assigneeType": "UNASSIGNED",
"isAssigneeTypeValid": False,
"project": "projectname" }
rest_url = url + '/rest/api/2/component'
headers ={'Content-Type': 'application/json'}
print rest_url
response = requests.post(rest_url, data = params, auth=auth, headers=headers, verify=False)