Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SimonAngatia's avatar

What is the correct way of sending json with a key having an empty numeric value?

Should it be 1 or 2? GameId key is numeric. Number two gives an error in postman: unexpected ,

1:

{"OperatorId":4563,"Session":"","GameId":"","RoundId":90587990,"Logins":["person"]}

2:

{"OperatorId":4563,"Session":"","GameId":,"RoundId":90587990,"Logins":["person"]}

0 likes
3 replies
SimonAngatia's avatar

Alright thanks, can it work without null or empty string? Like this GameId:, ?

tykus's avatar

It?

The JSON is invalid, so I expect any JSON parsing functionality will complain

Please or to participate in this conversation.