void HttpRequest::SetBody(const String& body, const String& contentType) { HttpServer::Connection* conn = (HttpServer::Connection*)connection; conn->set_body(body.CString()); if (contentType.Length()) SetResponseHeader("Content-Type", contentType); SetResponseHeader("Content-Length", String(body.Length())); }
NS_IMETHODIMP nsViewSourceChannel::SetResponseHeader(const nsACString & header, const nsACString & value, bool merge) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->SetResponseHeader(header, value, merge); }