I'm really new in Go and I have to integrate Zamzar in a Go microservice. I need to POST
a file and a data type (string).
Doing a curl
looks like this:
curl https://sandbox.zamzar.com/v1/jobs \
-u user:pass \
-X POST \
-F "source_file=@/tmp/portrait.gif" \
-F "target_format=png"
This is what I have so far:
client := &http.Client{}
req, err := http.NewRequest("GET", "https://sandbox.zamzar.com/v1/jobs", nil)
req.SetBasicAuth("user", "pass")
resp, err := client.Do(req)
if err != nil {
fmt.Printf("Error : %s", err)
} else {
fmt.Println(resp)
}
How can I send the target_format
as a string and source_file
as a file? I already have the file ([]byte
)