MCPcopy Create free account
hub / github.com/UiPath/uipathcli / writeMultipartBody

Method writeMultipartBody

executor/http_executor.go:177–190  ·  view source on GitHub ↗
(bodyWriter *io.PipeWriter, parameters []ExecutionParameter, cancel context.CancelCauseFunc)

Source from the content-addressed store, hash-verified

175}
176
177func (e HttpExecutor) writeMultipartBody(bodyWriter *io.PipeWriter, parameters []ExecutionParameter, cancel context.CancelCauseFunc) (string, int64) {
178 multipartSize := e.calculateMultipartSize(parameters)
179 formWriter := multipart.NewWriter(bodyWriter)
180 go func() {
181 defer func() { _ = bodyWriter.Close() }()
182 defer func() { _ = formWriter.Close() }()
183 err := e.writeMultipartForm(formWriter, parameters)
184 if err != nil {
185 cancel(err)
186 return
187 }
188 }()
189 return formWriter.FormDataContentType(), multipartSize
190}
191
192func (e HttpExecutor) writeInputBody(bodyWriter *io.PipeWriter, input stream.Stream, cancel context.CancelCauseFunc) {
193 go func() {

Callers 1

writeBodyMethod · 0.95

Calls 3

writeMultipartFormMethod · 0.95
CloseMethod · 0.80

Tested by

no test coverage detected