(body?: string)
| 916 | } |
| 917 | |
| 918 | public setupBodyStream(body?: string) { |
| 919 | if (body && this.progress.length) { |
| 920 | this.headers['content-length'] = `${body.length}`; |
| 921 | let shift = 0; |
| 922 | this.progress.forEach((loaded) => { |
| 923 | this.sub$.next(body.substring(shift, loaded)); |
| 924 | shift = loaded; |
| 925 | }); |
| 926 | this.sub$.next(body.substring(shift, body.length)); |
| 927 | } else { |
| 928 | this.sub$.next(body); |
| 929 | } |
| 930 | |
| 931 | this.sub$.complete(); |
| 932 | } |
| 933 | } |