(body?: string)
| 844 | } |
| 845 | |
| 846 | public setupBodyStream(body?: string) { |
| 847 | if (body && this.progress.length) { |
| 848 | this.headers['content-length'] = `${body.length}`; |
| 849 | let shift = 0; |
| 850 | this.progress.forEach((loaded) => { |
| 851 | this.sub$.next(body.substring(shift, loaded)); |
| 852 | shift = loaded; |
| 853 | }); |
| 854 | this.sub$.next(body.substring(shift, body.length)); |
| 855 | } else { |
| 856 | this.sub$.next(body); |
| 857 | } |
| 858 | |
| 859 | this.sub$.complete(); |
| 860 | } |
| 861 | } |