Closed JoyceBabu closed 6 years ago
navigator.sendBeacon currently supports only text/plain as the request Content-Type. But Restler does not allow text/plain, and is throwing the error
navigator.sendBeacon
text/plain
Content-Type
Forbidden: Content type text/plain is not supported.
Is there any alternative?
Worked around by sending an empty blob with content type set to application/x-www-form-urlencoded
application/x-www-form-urlencoded
navigator.sendBeacon('/api/endpoint.json', new Blob([''], {type : 'application/x-www-form-urlencoded'}));
navigator.sendBeacon
currently supports onlytext/plain
as the requestContent-Type
. But Restler does not allow text/plain, and is throwing the errorIs there any alternative?