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

Method writeMultipartBody

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

Source from the content-addressed store, hash-verified

106}
107
108func (c DuClient) writeMultipartBody(bodyWriter *io.PipeWriter, stream stream.Stream, contentType string, cancel context.CancelCauseFunc) string {
109 formWriter := multipart.NewWriter(bodyWriter)
110 go func() {
111 defer func() { _ = bodyWriter.Close() }()
112 defer func() { _ = formWriter.Close() }()
113 err := c.writeMultipartForm(formWriter, stream, contentType)
114 if err != nil {
115 cancel(err)
116 return
117 }
118 }()
119 return formWriter.FormDataContentType()
120}
121
122func (c DuClient) writeMultipartForm(writer *multipart.Writer, stream stream.Stream, contentType string) error {
123 filePart := textproto.MIMEHeader{}

Callers 1

Calls 2

writeMultipartFormMethod · 0.95
CloseMethod · 0.80

Tested by

no test coverage detected