class PostmanService {

    void appendRequestBody(StringBuilder html, Body body) {
        if (body == null || body.getMode() == null) {
            return;
        }

        switch (body.getMode()) {
            case "formdata":
                appendKeyValues(html, body.getFormData());
                break;
            case "urlencoded":
                appendKeyValues(html, body.getUrlEncoded());
                break;
            case "raw":
                html.append("<pre>").append(escapeHtml(body.getRaw())).append("</pre>\n");
                break;
            case "file":
                log.error("File upload was used in a collection, while its collection export is absent in Postman.");
                html.append(ERROR_PARAGRAPH +
                        "Postman does not export the files to upload, so it has not been sent..." +
                        PARAGRAPH_AND_LINE_END);
                break;
            default:
                log.error("Used new/unknown request body mode {}", body.getMode());
                html.append(ERROR_PARAGRAPH + "Used new (unknown to ARA) request body mode ")
                        .append(body.getMode())
                        .append(PARAGRAPH_AND_LINE_END);
                break;
        }
    }

}