[Solved] Combining string and []byte for payload
Here’s an example using multipart request. I modified this from a piece of code I have that deals with JSON docs, so there may be some mistakes in it, but it should give you the idea: body := bytes.Buffer{} writer := multipart.NewWriter(&body) hdr := textproto.MIMEHeader{} hdr.Set(“Content-Type”, “text/plain”) part, _ := writer.CreatePart(hdr) part.Write(data1) hdr = textproto.MIMEHeader{} … Read more