- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 04:53 PM
Hi,
Please can anyone help with how to handle this Error below.
Scripted Rest API :
When response is a single line string the functionality is working.
When response is a multiline line string then below error occurring.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 06:04 PM
Hi @Anusha48
due to REST API conventions "response" cannot be part of the URL because exactly then what happens as in your case: any critical chars like "\n" become part of the URL and break it.
The correct way is to send "response" within the body. In your Scripted REST API you can extract the value via
var res = request.body.data
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 06:04 PM
Hi @Anusha48
due to REST API conventions "response" cannot be part of the URL because exactly then what happens as in your case: any critical chars like "\n" become part of the URL and break it.
The correct way is to send "response" within the body. In your Scripted REST API you can extract the value via
var res = request.body.data
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 11:04 AM
Thanks @Maik Skoddow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 06:09 PM
Hi, unfortunately the screenshots don't really help clarify your issues. But I see in 'bad request' that the url seems to contain a new line char IE '\n' and I think you would need to use http special characters if you were creating\returning the value into a url.
HTML URL Encoding Reference (w3schools.com)