In python, I had this variable:
v = None
and this post request:
issue = {
"fields":
{
"project":
{
"id": 'x'
},
"summary": 's',
"issuetype":
{
"name": 'n'
},
"components":
[
{
"name": 'c1'
},
{
"name": v
},
]
}
After debugging I got this error message:
‘{"errorMessages":[],"errors":{"components":"Component name ‘None’ is not valid"}}’
The data is dynamic and that v as well, in case it is entered as a string then that won’t be no issue at all but it if is empty in the entered data I want to skip in the post request then that will be an issue.
In postman I had no issue I add null to it and then it works.
It is just that in python where I cannot find a way to add that null. hence I tried None, ‘null’ and no way.
Isn’t there any solution for this?
2
Answers
Resolved:
It looks like the post request is
json
format. The object you have is a python object; what you need is the json-formatted string equivalent: