Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Issue when using REST to submit to string field - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Issue when using REST to submit to string field
KB0549983

Issue when using REST to submit to string field


6580 Views Last updated : Apr 26, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Issue when using REST to submit to multi line text field | Optional



Details


Using a carriage return in a string field, such as description field when submitting a REST message it returns an "Invalid Request" response. 

This is experienced if using a REST message to insert or update a field of type string, having a the contents separated by a carriage return.

To avoid the "Invalid Request" response, substitute the carriage return with a "\n" in the REST message.

 

 

Symptom


Getting "Bad Request" when using REST message to insert or update a table in ServiceNow and the error message is:

{
error: {
message: "Exception while reading request"
detail: "Verify Request body and Content-type headers. Not able to parse request"
}-
status: "failure"
}

 

 

 

Cause


 Using the carriage return breaks the message and results in that the text message is not terminated correctly

 

 

Solution


The text submitted in the REST message must be correctly terminated.

Use a "\n" in place of the actual carriage return. 

Example:

Bad Request will contain the following:

{"short_description":"SN-REST Test", "description":"This is a line with
a second line"}

When processed the following response is received:

 
Please refer to "REST Message Bad Request response.png" attached
 
 
Successful request will contain the following:
{"short_description":"SN-REST Test", "description":"This is a line with \n a second line"}
 

 

The response will contain the details of the created record

Please refer to "REST Message - Successful.png" attached.

 

 

 


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.