Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

JSON response content type is set to text/html



User has a drop down with a Clipboard Page as the list source. The loading of the list source is set after the screen renders. It is observed that the URL call to retrieve the drop down options (pzGetDropdownOption activity) returns a JSON response but with the content type set to text/html. The the applicaiton is integrated with a 3rd party tracking layer, JS code will get embedded to all text/html response. As pzGetDropdownOption returns the content type as text/html, JS code is being injected to the response. Pega javascript client that consumes the response (pzpega_ui_dropdown.js) was not expecting non JSON content and throws an error.

Error Messages

JSON parsing error in pzpega_ui_dropdown.js

Steps to Reproduce

1) Create 2 drop downs.
2) Configure one can have the list source as a local list from the property.
3) Configure the other to have a list source from clipboard page (e.g a list view can update this clipboard page). Set this drop down list source to trigger after the screen renders.
4) Run fiddler and see the URL call to pzGetDropdownOption activity and the content type of the response saying text/html even thought it's a JSON response.

Root Cause

The root cause of this problem is a defect in Pegasystems’ code/rules. The javascript that consumes the response (pzpega_ui_dropdown.js) assumes the response to have pure JSON content. 


Hotfix item HFIX-21694 was provided where pzGetDropdownOption enclose the JSON with a div.
There is also additional code added to pzpega_ui_dropdown.js to pre-process the response so that only JSON content is passed to the parser.

Published June 3, 2015 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us