0

I am making a http request and getting response in JSON . When I am converting it to String using request.toString() but getting the truncated response response sample(This is the part of response which is causing issue) : params={account_code=il-496-8886, contact[id]=0, form_id=53774, page_id=68351, survey_field[10]=abc, survey_field[11]=abc, survey_field[12]=abc, survey_field[13]=abc, survey_field[14]=abc, ...}

But when i loop through this object before converting it to string it is giving all fields like below :

for(String str : request.params.keySet()){
            System.debug('====Key===='+str);
            System.debug('====Value===='+request.params.get(str));
        }

I am not sure how to convert it to string with out truncating it.Please help me if I am missing anything.

4
  • 3
    It might be only truncated in debug logs that are being shown. Are you sure that those are being truncated when sent to 3-rd party?
    – kurunve
    Commented Dec 22, 2023 at 10:41
  • Actually I am putting this in a field record value and its showing truncated in that field also. Commented Dec 22, 2023 at 11:40
  • 1
    for better debugging and full view of object use System.debug(JSON.serializePretty(request.params)); Commented Dec 22, 2023 at 12:28
  • Thanks @OleksandrBerehovskyi , it worked for me , I am able to get all the fields without any truncation. Commented Dec 26, 2023 at 6:24

1 Answer 1

1

I used System.debug(JSON.serializePretty(request)); method as suggested by @OleksandrBerehovskyi and it worked for me . I was able to get all the fields in the system field.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .