@kasterweb/http-stream-rn
v1.0.1
Published
Fetches and persist data from k-admin api
Downloads
2
Maintainers
Readme
Http Stream RN
Purpose
Downloads data from back-end using Range Requests and stream responses. Also, stores it locally in the device as a file.
| Platforms | Minimum | | --------- | :------: | | Android | SDK 23 | | iOS | iOS 12.4 |
Installation
yarn install http-stream-rn
Usage
import { doHTTPRequest } from 'http-stream-rn';
API
DoHTTPRequest
This method is responsible for executing http range request and persisting the response in phone's native storage.
Typescript Definition
doHTTPRequest(params: IParams): Promise<'success' | 'exception'>
DeleteFile
This method is responsible for deleting saved file in phone's native storage.
Typescript Definition
deleteFile(fileName: string, isDeleted: (result: true | false) => void): void
License
MIT