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

Method writeMultipartBody

utils/api/orchestrator_client.go:121–133  ·  view source on GitHub ↗
(bodyWriter *io.PipeWriter, stream stream.Stream, contentType string, cancel context.CancelCauseFunc)

Source from the content-addressed store, hash-verified

119}
120
121func (c OrchestratorClient) writeMultipartBody(bodyWriter *io.PipeWriter, stream stream.Stream, contentType string, cancel context.CancelCauseFunc) string {
122 formWriter := multipart.NewWriter(bodyWriter)
123 go func() {
124 defer func() { _ = bodyWriter.Close() }()
125 defer func() { _ = formWriter.Close() }()
126 err := c.writeMultipartForm(formWriter, stream, contentType)
127 if err != nil {
128 cancel(err)
129 return
130 }
131 }()
132 return formWriter.FormDataContentType()
133}
134
135func (c OrchestratorClient) writeMultipartForm(writer *multipart.Writer, stream stream.Stream, contentType string) error {
136 filePart := textproto.MIMEHeader{}

Callers 1

createUploadRequestMethod · 0.95

Calls 2

writeMultipartFormMethod · 0.95
CloseMethod · 0.80

Tested by

no test coverage detected