XMLHttpRequest for restful api calls. (not using the fetch API)
Hi, we have forked emscripten and implemented a small XMLHttpRequest library to perform api calls to webservices that used a RESTFUL interface.
There are few things we could NOT do it with the provided Fetch API: (Or the *wget and *wget2 helpers)
- using credentials (ie cookies, jwt, client certificate etc)
- using the full rest methods such as PUT,DELETE,OPTION,etc...
- using POST to send and receive data with different content-types.
So what we ended up with is a generic XMLHttpRequest helper that lets you add headers, credentials, content-type (POST in wget and wget2 is limited to x-www-form-urlencoded) via a unified interface. It uses the same callbacks as wget* so it's nice and easy to just drop and replace from your code.
(Just be clear I do not want to duplicate any feature of the fetch API but I think the fecth API is not the right place for XHR api calls)
Is this something you would be interested in a PR or are there already solutions to it?
cc @juj
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.