Files
m3o-go/examples/space/update/updateAnObject/main.go
2021-12-09 15:06:12 +00:00

22 lines
532 B
Go
Executable File

package main
import (
"fmt"
"os"
"go.m3o.com/space"
)
// Update an object. If an object with this name does not exist, creates a new one.
// You need to send the request as a multipart/form-data rather than the usual application/json
// with each parameter as a form field.
func main() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.Update(&space.UpdateRequest{
Name: "images/file.jpg",
Object: "<file bytes>",
Visibility: "public",
})
fmt.Println(rsp, err)
}