| 190 | } |
| 191 | |
| 192 | func (e HttpExecutor) writeInputBody(bodyWriter *io.PipeWriter, input stream.Stream, cancel context.CancelCauseFunc) { |
| 193 | go func() { |
| 194 | defer func() { _ = bodyWriter.Close() }() |
| 195 | data, err := input.Data() |
| 196 | if err != nil { |
| 197 | cancel(err) |
| 198 | return |
| 199 | } |
| 200 | defer func() { _ = data.Close() }() |
| 201 | _, err = io.Copy(bodyWriter, data) |
| 202 | if err != nil { |
| 203 | cancel(err) |
| 204 | return |
| 205 | } |
| 206 | }() |
| 207 | } |
| 208 | |
| 209 | func (e HttpExecutor) writeUrlEncodedBody(bodyWriter *io.PipeWriter, parameters []ExecutionParameter, cancel context.CancelCauseFunc) { |
| 210 | go func() { |