(body?: string)
| 906 | } |
| 907 | |
| 908 | public setupBodyStream(body?: string) { |
| 909 | if (body && this.progress.length) { |
| 910 | this.headers['content-length'] = `${body.length}`; |
| 911 | let shift = 0; |
| 912 | this.progress.forEach((loaded) => { |
| 913 | this.sub$.next(body.substring(shift, loaded)); |
| 914 | shift = loaded; |
| 915 | }); |
| 916 | this.sub$.next(body.substring(shift, body.length)); |
| 917 | } else { |
| 918 | this.sub$.next(body); |
| 919 | } |
| 920 | |
| 921 | this.sub$.complete(); |
| 922 | } |
| 923 | } |