Iam not able to get the json length, recently is there any changes in apigee edge cloud?

Hello Team,

Iam getting json request from backend, I want to get the length of json data.But now apigee treated json request as string and while using jsondata.length it is showing error as undefined.

Iam trying to convert json stringify and json parse methods but iam getting json length as string length format (its counting each character length) can any one help on this).

Thank you,

0 4 347
4 REPLIES 4

Not applicable

Did you try the request.header.Content-Length

Thank you for your response.

But I want the json data rows length iam getting as undefined

example:

{

"a": "jfjh",

"b":"fhh"

}

Above request length is 2 right but apigee not returning its length its returning each character length or if can I parse the json data it returns length as undefined.

Could you please help on it with some practical example.

how you calculate the length as 2? I think you are counting the number of objects. For that you can use javascript policy and count.

Show the code or configuration that you are using. Where are you evaluating "jsondata.length" ?