Create rancher secret via API

I’m trying to create a rancher secret for all namespaces, via the API (I’m pretty sure you can’t do this via kubectl or rancher CLIs - please let me know if that’s incorrect!).

So far, I’ve got:

curl --insecure -u token-:
–data “data.param1=value1” --data “data.param2=value2” --data “name=global-variable2”

However, I’ve tried a few methods of getting the data into the secret, with no joy. The secret resource is created, but when I do 'kubectl get -o yaml", I get the following:

apiVersion: v1
kind: Secret
annotations: user-q2crt c-j7dsx:p-98c6s “true” “true”
creationTimestamp: 2019-02-26T11:38:02Z
name: global-variable2
namespace: default
resourceVersion: “12185”
selfLink: /api/v1/namespaces/default/secrets/global-variable2
uid: f9491dac-39ba-11e9-b0bd-baeea5553cb1
type: Opaque

As you can see, there is no data there. Can anyone help?

Thanks in advance,

OK, I got there in the end:

curl --insecure -u
–header “Content-Type: application/json”
–request POST
–data ‘{“name”:“global-variable10”, “data”: {“test”:“dmFsdWUxCg==”, “test2”:“YmFuYW5hcwo=”}}’