示例#1
0
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()));
}
示例#2
0
NS_IMETHODIMP
nsViewSourceChannel::SetResponseHeader(const nsACString & header,
                                       const nsACString & value, bool merge)
{
    return !mHttpChannel ? NS_ERROR_NULL_POINTER :
        mHttpChannel->SetResponseHeader(header, value, merge);
}