Trouble with the curl command and HTTP API

I’m using the HTTP API with curl and vbscripts to automate some lighting tasks. I have successfully used the Set Power curl example in the API documentation to change the state of the bulbs. However, when I try to change the state and duration. I get a response of error: state type not valid. I tried the command with curl and other forms like below but I can’t figure out the command structure to set both state and duration. Any advice would be appreciated, I’m very new to all this.

curl -H “Authorization: Bearer YOUR_APP_TOKEN” -X PUT -d “state=on” -d “duration=120” “

Try combining the parameters into a single switch. They work like a query string in a URL.

curl -H "Authorization: Bearer YOUR_APP_TOKEN" -X PUT -d "state=on&duration=120" ""

I was under the impression when curl encountered two or more -d options in the command line it would combine into what you suggested. I tried your suggestion and it worked. Thanks for your help.