uploadData => uploadRawData
This commit is contained in:
parent
9536ebc0ad
commit
61576c39be
6 changed files with 10 additions and 6 deletions
|
@ -215,7 +215,7 @@ Converter<scoped_refptr<ResourceRequestBodyImpl>>::ToV8(
|
|||
std::unique_ptr<base::Value> bytes(
|
||||
base::BinaryValue::CreateWithCopiedBuffer(
|
||||
element.bytes(), static_cast<size_t>(element.length())));
|
||||
post_data_dict->SetString("type", "data");
|
||||
post_data_dict->SetString("type", "rawData");
|
||||
post_data_dict->Set("bytes", std::move(bytes));
|
||||
} else if (type == ResourceRequestBodyImpl::Element::TYPE_FILE) {
|
||||
post_data_dict->SetString("type", "file");
|
||||
|
@ -257,7 +257,7 @@ bool Converter<scoped_refptr<ResourceRequestBodyImpl>>::FromV8(
|
|||
if (!list->GetDictionary(i, &dict))
|
||||
return false;
|
||||
dict->GetString("type", &type);
|
||||
if (type == "data") {
|
||||
if (type == "rawData") {
|
||||
base::BinaryValue* bytes = nullptr;
|
||||
dict->GetBinary("bytes", &bytes);
|
||||
(*out)->AppendBytes(bytes->GetBuffer(), bytes->GetSize());
|
||||
|
|
|
@ -969,7 +969,7 @@ Same as `webContents.capturePage([rect, ]callback)`.
|
|||
* `httpReferrer` String - A HTTP Referrer url.
|
||||
* `userAgent` String - A user agent originating the request.
|
||||
* `extraHeaders` String - Extra headers separated by "\n"
|
||||
* `postData` ([UploadData](structures/upload-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
|
||||
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
|
||||
|
||||
Same as `webContents.loadURL(url[, options])`.
|
||||
|
||||
|
|
4
docs/api/structures/upload-raw-data.md
Normal file
4
docs/api/structures/upload-raw-data.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Upload RawData Object
|
||||
|
||||
* `type` String - `rawData`.
|
||||
* `bytes` Buffer - Data to be uploaded.
|
|
@ -490,7 +490,7 @@ win.loadURL('http://github.com')
|
|||
* `httpReferrer` String - A HTTP Referrer url.
|
||||
* `userAgent` String - A user agent originating the request.
|
||||
* `extraHeaders` String - Extra headers separated by "\n"
|
||||
* `postData` ([UploadData](structures/upload-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
|
||||
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
|
||||
|
||||
Loads the `url` in the window. The `url` must contain the protocol prefix,
|
||||
e.g. the `http://` or `file://`. If the load should bypass http cache then
|
||||
|
|
|
@ -265,7 +265,7 @@ webview.addEventListener('dom-ready', () => {
|
|||
* `httpReferrer` String - A HTTP Referrer url.
|
||||
* `userAgent` String - A user agent originating the request.
|
||||
* `extraHeaders` String - Extra headers separated by "\n"
|
||||
* `postData` ([UploadData](structures/upload-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
|
||||
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
|
||||
|
||||
Loads the `url` in the webview, the `url` must contain the protocol prefix,
|
||||
e.g. the `http://` or `file://`.
|
||||
|
|
|
@ -29,7 +29,7 @@ describe('browser-window module', function () {
|
|||
const fileStats = fs.statSync(filePath)
|
||||
postData = [
|
||||
{
|
||||
'type': 'data',
|
||||
'type': 'rawData',
|
||||
'bytes': new Buffer('username=test&file=')
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue