xior supports file uploads using the FormData API and provides an optional 'xior/plugins/progress' plugin for simulating upload progress, usage simila

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-05-09 10:00:07

xior supports file uploads using the FormData API and provides an optional 'xior/plugins/progress' plugin for simulating upload progress, usage similar to Axios.

The retry key for the unique request generated by use params and data, if your request depends on headers, you can add request interceptor to add headers's value to params:

Enable upload and download progress like axios, but the progress is simulated, This means it doesn't represent the actual progress but offers a user experience similar to libraries like axios.

Yes, xior works anywhere where the native fetch API is supported. Even if the environment doesn't support fetch, you can use a fetch polyfill like for older browsers.

And to handle a stream response, use the responseType: 'stream' option in your request, then do something with the response as fetch does:

Good to Know: add {responseType: 'stream'} options will tell xior no need process response, and return original response in format {response}

Leave a Comment