Это указывается потребителем API. Поскольку вы сказали, что вызываете его с веб-страницы, проиллюстрируйте пример с использованием API javascript fetch .
Пример POST:
fetch("/customers/' + custId, {
method: 'POST',
body: JSON.stringify(data), //data being your customer data
headers:{
'Content-Type': 'application/json'
}
}).then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));
GET пример:
fetch("/customers/' + custId) //if not specified, fetch defaults to GET
.then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));