req.Header.Add("Content-Type", writer.FormDataContentType())
If you're reading this, do not forget the Content-Type
. It is not on the initial example, but it is important. I don't understand why the author mentions it here but doesn't use it on the initial source.