A Doc String passes a large, multi-line block of text (like a JSON payload, an email body, or a message) to a single step, delimited by triple quotes in the feature file.
When a step needs more than a short phrase — an expected JSON response, a long comment, an HTML snippet — you attach a Doc String using triple double-quotes (""") on the lines after the step. The step definition receives it as a String parameter. This keeps big text out of the step sentence and preserves formatting/whitespace. Doc Strings pair well with API scenarios (posting or asserting a JSON body). You can optionally give a content type after the opening delimiter. Use them when the data is genuinely large; for a few values a DataTable or inline parameters is clearer.
When the API receives the request:\n """\n { "name": "QA", "active": true }\n """\n— the JSON body is passed as a string to the step that POSTs it.
You need to pass a full JSON request body to a Cucumber step. DataTable or Doc String, and why?