Im making a POST to an endpoint and this is what I get back in my response, its a successful POST and the status is 200 but the payload is empty.
{
"payload":[],
"datetimestamp":"2023-03-23_01:26:45"
}
storing it in a string and making a map
String strJSON = response.getBody();
Map < String, Object > fullMap = ( Map < String, Object > )JSON.deserializeUntyped( strJSON );
now when I debug this:
System.debug('fullmap payload-->' + fullMap.get('payload'));
I get back this : fullmap payload-->()
how can i validate that this is empty? I tried the following
Object obj2 = fullMap.get('payload');
if(obj2 == '()'){
System.debug('hi');
}
Basically I want to know when the payload is empty, so I can have logic there.