mirror of
https://github.com/electron/electron.git
synced 2026-02-15 17:45:33 -05:00
Merge pull request #8157 from electron/post-data-example
Add simple postData example to docs
This commit is contained in:
@@ -1004,6 +1004,19 @@ let url = require('url').format({
|
||||
win.loadURL(url)
|
||||
```
|
||||
|
||||
You can load a URL using a `POST` request with URL-encoded data by doing
|
||||
the following:
|
||||
|
||||
```javascript
|
||||
win.loadURL('http://localhost:8000/post', {
|
||||
postData: [{
|
||||
type: 'rawData',
|
||||
bytes: Buffer.from('hello=world')
|
||||
}],
|
||||
extraHeaders: 'Content-Type: application/x-www-form-urlencoded'
|
||||
})
|
||||
```
|
||||
|
||||
#### `win.reload()`
|
||||
|
||||
Same as `webContents.reload`.
|
||||
|
||||
Reference in New Issue
Block a user