mirror of
https://github.com/Kong/insomnia.git
synced 2026-06-18 04:53:50 -04:00
17 lines
384 B
JavaScript
Executable File
17 lines
384 B
JavaScript
Executable File
const fetchOptions = {
|
|
mode: 'cors',
|
|
method: 'POST',
|
|
headers: {
|
|
cookie: 'foo=bar; bar=baz',
|
|
accept: 'application/json',
|
|
'content-type': 'application/x-www-form-urlencoded',
|
|
},
|
|
body: {
|
|
foo: 'bar',
|
|
},
|
|
};
|
|
|
|
fetch('http://mockbin.com/har?foo=bar&foo=baz&baz=abc&key=value', fetchOptions)
|
|
.then(response => response.json())
|
|
.then(data => console.log(data));
|