(body?: string)
| 935 | } |
| 936 | |
| 937 | public setupBodyStream(body?: string) { |
| 938 | if (body && this.progress.length) { |
| 939 | this.headers['content-length'] = `${body.length}`; |
| 940 | let shift = 0; |
| 941 | this.progress.forEach((loaded) => { |
| 942 | this.sub$.next(body.substring(shift, loaded)); |
| 943 | shift = loaded; |
| 944 | }); |
| 945 | this.sub$.next(body.substring(shift, body.length)); |
| 946 | } else { |
| 947 | this.sub$.next(body); |
| 948 | } |
| 949 | |
| 950 | this.sub$.complete(); |
| 951 | } |
| 952 | } |