本文整理汇总了C++中PassRefPtrWillBeRawPtr::createMultiPartFormData方法的典型用法代码示例。如果您正苦于以下问题:C++ PassRefPtrWillBeRawPtr::createMultiPartFormData方法的具体用法?C++ PassRefPtrWillBeRawPtr::createMultiPartFormData怎么用?C++ PassRefPtrWillBeRawPtr::createMultiPartFormData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PassRefPtrWillBeRawPtr
的用法示例。
在下文中一共展示了PassRefPtrWillBeRawPtr::createMultiPartFormData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendBeacon
bool BeaconLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beaconURL, PassRefPtrWillBeRawPtr<DOMFormData>& data, int& payloadLength)
{
ASSERT(data);
ResourceRequest request(beaconURL);
prepareRequest(frame, request);
RefPtr<FormData> entityBody = data->createMultiPartFormData();
unsigned long long entitySize = entityBody->sizeInBytes();
if (allowance > 0 && static_cast<unsigned long long>(allowance) < entitySize)
return false;
AtomicString contentType = AtomicString("multipart/form-data; boundary=", AtomicString::ConstructFromLiteral) + entityBody->boundary().data();
request.setHTTPBody(entityBody.release());
request.setHTTPContentType(contentType);
issueRequest(frame, request);
payloadLength = entitySize;
return true;
}