I've got a thermal scanner that I'm trying to send triggers to. I'm able to achieve desired results with postman, but I need a standalone script to achieve this so I've been working in powershell. The manufacturer documentation merely specifies a POST as application/json and provide the raw format to be sent in the body as such:
{
"data": [
{
"output": "DO2",
"mode": "ON",
"duration": 5,
"delay": false
}
]
}
Like I said, I have no issues getting the desired result using postman, but I can't figure out how this needs to be formatted in powershell. Powershell isn't complaining about my code, but the device is not accepting the commands like it does from postman, probably because my code is garbage and the device isn't receiving the data correctly. The documentation says to input this data in the body so I have defined the body variable and simply call the variable when Invoke-Restmethod:
$body = ConvertTo-Json @(
'{"data":[
{
"output": "DO2"
"mode": "ON"
"duration": "5"
"delay": false
}
]
}'
)
any help would be appreciated and thanks in advance!