Open lone1y-51 opened 1 year ago
try this? { "describe": "1. this is first line\n2. this is second line", "key": "this is key" }
ChatGPT gave the same answer. When insisting with "That's fine, but I want to avoid having to insert \n manually and rest client should do this for me" it responded:
To include multiline text in the VS Code REST Client plugin without manually inserting \n characters, you can use triple quotes (""") to allow the plugin to handle newlines automatically. This feature makes the request body more readable, especially for longer texts. Here's an example:
POST https://example.com/api/endpoint Content-Type: application/json { "message": """ This is the first line. This is the second line. This is the third line. """ }
When you use triple quotes, the REST Client will automatically convert the multiline text into a single-line string with \n characters where the newlines are in your input. This simplifies writing and maintaining requests with multiline text.
Probably it read this feature request... :) I'd love to define variables in that manner with long texts copy pasted.
my api body is json but some json field has multi-line, like this
but this style cant post