emscripten-forge / requests-wasm-polyfill

Drop-in replacement for the requests library for wasm python
9 stars 2 forks source link

send does not work if you have data in the request: #6

Open pjaggi1 opened 11 months ago

pjaggi1 commented 11 months ago

https://github.com/emscripten-forge/requests-wasm-polyfill/blob/5a66b884cf05cf4e20d42f1fd8f8b005d843ecc6/requests/api.py#L43

pjaggi1 commented 11 months ago

still need to call xmlhr, but with data as argument?

DerThorsten commented 11 months ago

when I wrote this I did not test send very much (or at all) since I was mostly interested in getting downloads to work. But I am happy to merge any PR =)

albop commented 10 months ago

That would be very useful indeed ? Do you know what is blocking?

DerThorsten commented 10 months ago

That would be very useful indeed ? Do you know what is blocking?

I think it just needs someone implementing it :-)

albop commented 10 months ago

Yes of course ! My request was malformed. I was wondering if you have some knowledge of foreseeable complications. Like a dependency that would not be available in wasm... Or some reason for why data requests are more complicated to post from the wasm side ?

DerThorsten commented 10 months ago

you can probably just copy paste from https://github.com/koenvo/pyodide-http/tree/main/pyodide_http which is basically the same project, just for pyodide.

DerThorsten commented 10 months ago

in particular this https://github.com/koenvo/pyodide-http/blob/main/pyodide_http/_core.py#L75

albop commented 10 months ago

Thanks. I'll give it a try