seven332 / quickjs-android

QuickJS Android wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I use axios in js, but throw error

s949492225 opened this issue · comments

commented

I use axios in js, but throw error
is this not support axios?

No.
Axios requires http API in Node.js, or XMLHttpRequests in a browser. But QuickJS is only a js interpreter. No dom, no Node.js API.

It's still possible to make http requests. You can call any java code in js like this.
https://github.com/seven332/quickjs-android/blob/wrapper/library/src/androidTest/java/com/hippo/quickjs/android/JSFunctionCallbackTest.java#L14