(body?: string)
| 1103 | } |
| 1104 | |
| 1105 | public setupBodyStream(body?: string) { |
| 1106 | if (body && this.progress.length) { |
| 1107 | this.headers['content-length'] = `${body.length}`; |
| 1108 | let shift = 0; |
| 1109 | this.progress.forEach((loaded) => { |
| 1110 | this.sub$.next(body.substring(shift, loaded)); |
| 1111 | shift = loaded; |
| 1112 | }); |
| 1113 | this.sub$.next(body.substring(shift, body.length)); |
| 1114 | } else { |
| 1115 | this.sub$.next(body); |
| 1116 | } |
| 1117 | |
| 1118 | this.sub$.complete(); |
| 1119 | } |
| 1120 | } |