How to post JSON data with null as value in python request [duplicate]
up vote
-1
down vote
favorite
This question already has an answer here:
Why can't I use true/false/null in a Python object fed to json.dumps()?
3 answers
I have JSON data which which needs to formated and sent to the server with null values set as null.
A dictionary in Python cannot have null as value but can have "null" as a value. How do I convert the above to a dictionary that Python recognizes?
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":null,"scale":null}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'null' is not defined
python json post
New contributor
marked as duplicate by jonrsharpe
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
yesterday
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
-1
down vote
favorite
This question already has an answer here:
Why can't I use true/false/null in a Python object fed to json.dumps()?
3 answers
I have JSON data which which needs to formated and sent to the server with null values set as null.
A dictionary in Python cannot have null as value but can have "null" as a value. How do I convert the above to a dictionary that Python recognizes?
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":null,"scale":null}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'null' is not defined
python json post
New contributor
marked as duplicate by jonrsharpe
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
yesterday
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
This question already has an answer here:
Why can't I use true/false/null in a Python object fed to json.dumps()?
3 answers
I have JSON data which which needs to formated and sent to the server with null values set as null.
A dictionary in Python cannot have null as value but can have "null" as a value. How do I convert the above to a dictionary that Python recognizes?
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":null,"scale":null}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'null' is not defined
python json post
New contributor
This question already has an answer here:
Why can't I use true/false/null in a Python object fed to json.dumps()?
3 answers
I have JSON data which which needs to formated and sent to the server with null values set as null.
A dictionary in Python cannot have null as value but can have "null" as a value. How do I convert the above to a dictionary that Python recognizes?
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":null,"scale":null}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'null' is not defined
This question already has an answer here:
Why can't I use true/false/null in a Python object fed to json.dumps()?
3 answers
python json post
python json post
New contributor
New contributor
New contributor
asked yesterday
Dhananjay Singh
11
11
New contributor
New contributor
marked as duplicate by jonrsharpe
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
yesterday
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by jonrsharpe
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
yesterday
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
The equivalent of the null keyword in Python is None.
Try
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":None,"scale":None}
New contributor
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The equivalent of the null keyword in Python is None.
Try
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":None,"scale":None}
New contributor
add a comment |
up vote
1
down vote
The equivalent of the null keyword in Python is None.
Try
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":None,"scale":None}
New contributor
add a comment |
up vote
1
down vote
up vote
1
down vote
The equivalent of the null keyword in Python is None.
Try
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":None,"scale":None}
New contributor
The equivalent of the null keyword in Python is None.
Try
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":None,"scale":None}
New contributor
New contributor
answered yesterday
Paritosh Singh
1665
1665
New contributor
New contributor
add a comment |
add a comment |