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

Cannot set 'HTTP/1.1 200 OK' in REST Service Response Header



Unable to generate Service REST response with status as 'HTTP/1.1 200 OK' in the REST Service Response Header.

Error Messages

[ttp-nio-8080-exec-25] [STANDARD] [ ] [OrigApp:01.01.01] ( ERROR| |Rest|poc|v1|solacepocf3dd60c6825baaa1c341db4b9917ff8b|A65NTMW9HESUK8ZGDBAWJJI65XBEJZXB2 - Rest service [poc][v1][solacepocf3dd60c6825baaa1c341db4b9917ff8b] failed:For input string: "200 OK": java.lang.NumberFormatException: For input string: "200 OK"
at java.lang.NumberFormatException.forInputString(
at java.lang.Integer.parseInt( at java.lang.Integer.parseInt(
at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.activityExecutionEpilog(
at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(

Steps to Reproduce

  1. Create a simple REST Service.
  2. Set the Status Code as 200 OK.
  3. Invoke the service.

Root Cause

The NumberFormatException displays because the rule form only accepts numeric codes for the Status code field.  Adding a string such as 'OK' to the standard HTTP 200 code for any request is not allowed in the product. This is due to the application server.
Hence, there is no provision to set HTTP Status codes along with string messages such as '200 OK' or '201 Created' in the Service REST responses.


Here's the explanation for the reported behavior:

Standard HTTP success status codes for Service REST requests or any other HTTP requests are set by javax.servlet.http.HttpServletResponse API.
The application invokes setStatus(int) with the relevant numeric status code. Adding a string such as 'OK' for 200 is not controlled in the product.

'HTTP/1.1 200 OK' or 'HTTP/1.1 200' depends on the servlet API version used by the user's application server.
The Tomcat version which provided the '200 OK' in HTTP responses is Apache Tomcat 8.0.53.


Published December 4, 2018 - Updated December 2, 2021

Was this useful?

100% 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