Add simple postData example
This commit is contained in:
parent
f1f73eff04
commit
e198b6945c
1 changed files with 13 additions and 0 deletions
|
@ -1004,6 +1004,19 @@ let url = require('url').format({
|
||||||
win.loadURL(url)
|
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()`
|
#### `win.reload()`
|
||||||
|
|
||||||
Same as `webContents.reload`.
|
Same as `webContents.reload`.
|
||||||
|
|
Loading…
Add table
Reference in a new issue