I am currently working in Golang, I am developing an API, in a POST handler I need to receive in the Post form an array but with named positions, I mean, something like this:

myarray[a]:"some Value"
myarray[otherName]: "some Other value"
myarray[x] : "something different"

Right now I am trying making the Post request using curl in the CLI. I am sending this:

curl -i -X POST --url http://localhost:20000/myendpoint -H "Content-Type: application/x-www-form-urlencoded" -d 'Name=Comp&myarray[x]=somethingdifferent&myarray[otherName]=someOtherValue'

And, indeed when I print the form values in Go, I get:

[myarray[x]:[somethingdifferent] myarray[otherName]:[someOtherValue]]
myarray
req.Form["myarray"]

I get nothing there, my purpose is to get that array and store it as a JSON object in the database due that I don't know which field can be sent in that array. I need something like:

myarray[[x]=somethingdifferent,[otherName]=someOtherValue]