Unexpected token in JSON
Posted: Fri Oct 08, 2021 12:42 pm
Is there a simple way to check if the value of an object has been passed in node js? It does not seem to matter if the object in the module is defined as character or decimal.
For example, within the body of a request
{
"quantity": 1,
"weight": 100
}
when looking at the object "quantity": 1 ,
the error occurs when in the body of the request my client passes "quantity" : , specifying no value for quantity
{
"quantity": ,
"weight": 100
}
For example, within the body of a request
{
"quantity": 1,
"weight": 100
}
when looking at the object "quantity": 1 ,
the error occurs when in the body of the request my client passes "quantity" : , specifying no value for quantity
{
"quantity": ,
"weight": 100
}