本文整理汇总了C++中FormData::decode方法的典型用法代码示例。如果您正苦于以下问题:C++ FormData::decode方法的具体用法?C++ FormData::decode怎么用?C++ FormData::decode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormData
的用法示例。
在下文中一共展示了FormData::decode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: id
PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData(
String& contentType) const {
if (m_additionalData.isURLSearchParams()) {
// If |additionalData| is a 'URLSearchParams' object, build a urlencoded
// response.
URLSearchParams* params = URLSearchParams::create(URLSearchParamsInit());
URLSearchParams* additionalData = m_additionalData.getAsURLSearchParams();
for (const auto& param : additionalData->params()) {
const String& name = param.first;
if (name != idName() && name != passwordName())
params->append(name, param.second);
}
params->append(idName(), id());
params->append(passwordName(), password());
contentType =
AtomicString("application/x-www-form-urlencoded;charset=UTF-8");
return params->toEncodedFormData();
}
// Otherwise, we'll build a multipart response.
FormData* formData = FormData::create(nullptr);
if (m_additionalData.isFormData()) {
FormData* additionalData = m_additionalData.getAsFormData();
for (const FormData::Entry* entry : additionalData->entries()) {
const String& name = formData->decode(entry->name());
if (name == idName() || name == passwordName())
continue;
if (entry->blob())
formData->append(name, entry->blob(), entry->filename());
else
formData->append(name, formData->decode(entry->value()));
}
}
formData->append(idName(), id());
formData->append(passwordName(), password());
RefPtr<EncodedFormData> encodedData = formData->encodeMultiPartFormData();
contentType = AtomicString("multipart/form-data; boundary=") +
encodedData->boundary().data();
return encodedData.release();
}