diff --git a/atom/common/native_mate_converters/content_converter.cc b/atom/common/native_mate_converters/content_converter.cc index 0b07b6d39490..72f1011a72c3 100644 --- a/atom/common/native_mate_converters/content_converter.cc +++ b/atom/common/native_mate_converters/content_converter.cc @@ -215,7 +215,7 @@ Converter>::ToV8( std::unique_ptr bytes( base::BinaryValue::CreateWithCopiedBuffer( element.bytes(), static_cast(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>::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()); diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 05fbf1bff26a..304c24c3a1f0 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -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])`. diff --git a/docs/api/structures/upload-raw-data.md b/docs/api/structures/upload-raw-data.md new file mode 100644 index 000000000000..5632d8e2c6ec --- /dev/null +++ b/docs/api/structures/upload-raw-data.md @@ -0,0 +1,4 @@ +# Upload RawData Object + +* `type` String - `rawData`. +* `bytes` Buffer - Data to be uploaded. diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index fc3fec3baf7e..638851da9e57 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -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 diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 592eb5907ee4..884e4f39d9d7 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -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://`. diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index f4bb529b605c..e8a12aae19d9 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -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=') }, {