An Aurelia SPA uses fetch against a different origin server. A preflight OPTIONS request is sent and because the server is configured to respond, the response is 200 OK.
But that's all that happens.
What must I add to make the rest of it happen?
Here's the request.
this.http.fetch(this.LabelServiceUrl, {
method: "post",
mode: "cors",
headers: {
"Content-type": "application/json; charset=UTF-8"
},
body: json({
printer: this.LabelPrinter,
html: html
})
}).then(json)
.then(response => {
console.log('Success:', JSON.stringify(response))
})
.catch(error => {
console.error('Error:', error)
});
IIS is configured by web.config
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>