Можно еще так. Запрос
OPTIONS
выполняется отдельно, после него
POST
.
const request = new Request('http://192.168.88.3:9090/API/V0.1/schedule_query/ESIAFindAccount/', {
method: 'POST',
headers: new Headers({
'Content-Type': 'application/json',
'X-Auth-Token': 'xxx'
}),
body: JSON.stringify({
RoutingCode: 'TESIA',
SnilsOperator: '135-419-238 52',
ra: '1000321282',
lastName: 'Тестов',
firstName: 'Тест',
middleName: 'Тестович',
doc: {
type: 'RF_PASSPORT',
series: '1111',
number: '111111'
},
mobile: '+7(920)4021351',
snils: '229-785-346 20'
})
});
fetch(request).then(response => response.json()).then(console.log);