1const url = 'https://randomuser.me/api';
2// The data we are going to send in our request
3let data = {
4 name: 'Sara'
5}
6// The parameters we are gonna pass to the fetch function
7let fetchData = {
8 method: 'POST',
9 body: data,
10 headers: new Headers()
11}
12fetch(url, fetchData)
13.then(function() {
14 // Handle response you get from the server
15});