I have a jpeg image.Image
and I want to decode
to a request body. Simplified below, it doesn't seem to finish the request ever. The program hangs.
r, w := io.Pipe()
jpeg.Encode(w, img, &jpeg.Options{ 80 })
req, e := http.NewRequest("PUT", myUrl, r)
if e != nil {
return nil, e
}
http.DefaultClient.Do(req)
How can I write an image to the request body?