Sets the body of the response. If a body is added, no template rendering will be
performed. The content type "text/plain" will be used.

@param text The text for the response

@return A response object {@link io.mangoo.routing.Response}
975387
public Response andTextBody(String text) {
        this.contentType = MediaType.PLAIN_TEXT_UTF_8.withoutParameters().toString();
        this.body = text;
        this.rendered = false;

        return this;
    }
399588
public MockResponse setBody(String body) {
        try {
            return setBody(body.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            throw new AssertionError();
        }
    }
1224972
@Internal
    public void setBody(T body) {
        this.body = () -> Optional.ofNullable(body);
        this.convertedBodies.clear();
    }
1267642
public Request setContent(String text, ContentType contentType) {
        entity = new StringEntity(text, contentType);
        return this;
    }
1036593
public T html(final String text) {
        if (TextUtils.isEmpty(text)) {
            return text("");
        }
        if (text.contains("<") && text.contains(">")) {
            if (view instanceof TextView)
                ((TextView)view).setMovementMethod(LinkMovementMethod.getInstance());
            return text(Html.fromHtml(text));

        } else {
            return text(text);
        }
    }
921602
public void setText(String text) {
        input.setText("");
        if (text != null) {
            input.append(text);
        }
    }
577189
@Override
    public StandaloneAhcWSRequest setBody(BodyWritable bodyWritable) {
        this.bodyWritable = bodyWritable;

        String contentType = bodyWritable.contentType();
        if (!headers.containsKey(HttpHeaders.Names.CONTENT_TYPE) && contentType != null) {
            this.addHeader(HttpHeaders.Names.CONTENT_TYPE, bodyWritable.contentType());
        }

        return this;
    }
416293
public synchronized TextBox setText(String text) {
        String[] split = text.split("\n");
        if (split.length == 0) {
            split = new String[] { "" };
        }
        lines.clear();
        longestRow = 1;
        for(String line : split) {
            addLine(line);
        }
        if(caretPosition.getRow() > lines.size() - 1) {
            caretPosition = caretPosition.withRow(lines.size() - 1);
        }
        if(caretPosition.getColumn() > lines.get(caretPosition.getRow()).length()) {
            caretPosition = caretPosition.withColumn(lines.get(caretPosition.getRow()).length());
        }
        invalidate();
        return this;
    }
471895
function _setResponseBody(body) {
    verifyRequestSent(this);
    verifyHeadersReceived(this);
    verifyResponseBodyType(body);

    var chunkSize = this.chunkSize || 10;
    var index = 0;
    this.responseText = "";

    do {
      if (this.async) {
        this._readyStateChange(FakeXMLHttpRequest.LOADING);
      }

      this.responseText += body.substring(index, index + chunkSize);
      index += chunkSize;
    } while (index < body.length);

    var type = this.getResponseHeader("Content-Type");

    if (this.responseText && (!type || /(text\/xml)|(application\/xml)|(\+xml)/.test(type))) {
      try {
        this.responseXML = parseXML(this.responseText);
      } catch (e) {
        // Unable to parse XML - no biggie
      }
    }

    if (this.async) {
      this._readyStateChange(FakeXMLHttpRequest.DONE);
    } else {
      this.readyState = FakeXMLHttpRequest.DONE;
    }
  }
244903
@POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.APPLICATION_JSON)
    public static Collection<Utterance> mapText(final String text)
            throws IOException, InterruptedException, JAXBException, SQLException, ParserConfigurationException,
                   SAXException {
        return mapTextWithOptions(new AnalysisRequest(text));
    }
149302
public Element appendText(String text) {
        Validate.notNull(text);
        TextNode node = new TextNode(text);
        appendChild(node);
        return this;
    }
983135
public <T> Message body(T body, Charset charset) {
        messageWriter.writeBody(body, charset);
        return this;
    }
226936
public final void setSourceText(final String text) {
        if (SwingUtilities.isEventDispatchThread()) {
            setSourceTextIntern(text);
        } else {
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        setSourceTextIntern(text);
                    }
                });
            } catch (final Exception ex) {
                ignore();
            }
        }
    }
130688
public final void setBackButtonText(@NonNull final CharSequence text) {
        Condition.INSTANCE.ensureNotNull(text, "The text may not be null");
        Condition.INSTANCE.ensureNotEmpty(text, "The text may not be empty");
        this.backButtonText = text;
        adaptBackButtonText();
    }
584607
public HttpRequest withBody(String body, Charset charset) {
        if (body != null) {
            this.body = new StringBody(body, charset);
        }
        return this;
    }
416380
public RequestTemplate body(Request.Body body) {
    this.body = body;

    header(CONTENT_LENGTH);
    if (body.length() > 0) {
      header(CONTENT_LENGTH, String.valueOf(body.length()));
    }

    return this;
  }
463087
public void setAdditionalText(String text) {

        if (CmsStringUtil.isEmpty(text)) {
            m_additionalText.setVisible(false);
        } else {
            m_additionalText.setValue(text);
            m_additionalText.setVisible(true);
        }
    }