seed icon indicating copy to clipboard operation
seed copied to clipboard

Please add an example down/up loading cbor/bson and other binary formats (with serde)

Open matiu2 opened this issue 5 years ago • 1 comments

I'm having trouble groking how to get data out of the fetch::Request::fetch() method.

Sorry this is more of a support request than an issue.

matiu2 avatar Feb 19 '20 22:02 matiu2

Try to get "raw" response:

  • Current Fetch API: https://github.com/seed-rs/seed/blob/5e61a6e3d877e5bc94bc9a6df85f54c8f6e3ce26/src/browser/service/fetch.rs#L67
  • New (WIP, but simpler) API - https://github.com/seed-rs/seed/pull/353 + https://github.com/TatriX/seed/blob/d54567c98d0a4f4f85dd98c32896661d7f888df2/src/browser/fetch/response.rs#L59

And then try to get blob or byte array from the body:

  • https://developer.mozilla.org/en-US/docs/Web/API/Body
  • https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Response.html#method.array_buffer

If you want to help with the example, please create or find a backend API that accepts and returns cbor/bson/x (ideally echo API). Or we can add it to server_integration example if Actix can do that.

MartinKavik avatar Feb 20 '20 13:02 MartinKavik

obsolete since v0.10.0

flosse avatar Mar 07 '23 00:03 flosse