| 1196 | { |
| 1197 | SC_TRY(startBody(code, body.sizeInBytes(), contentType)); |
| 1198 | SC_TRY(sendHeaders()); |
| 1199 | if (body.sizeInBytes() > 0) |
| 1200 | { |
| 1201 | SC_TRY(getWritableStream().write(AsyncBufferView(body))); |
| 1202 | } |
| 1203 | return end(); |
| 1204 | } |
| 1205 | |
| 1206 | Result HttpResponse::sendBody(int code, StringSpan body, StringSpan contentType) |
| 1207 | { |
| 1208 | return sendBytes(code, body.toCharSpan(), contentType); |
| 1209 | } |