Hi Miran,
I think your API query framing is not correct, end point must be placed after the body, for your reference please see the below PFREST/SVOS API, as API has a standardized query syntax hence almost all APIs' will have same structure.
Below API creates a ldev in the storage [we bypassed the SSL handshake]
curl -k -v -H "Accept:application/json" -H "Content-Type:application/json" -u <user_id>:<password> -X POST -d " { \"poolId\" : \"1\",\"byteFormatCapacity\" : \"10G\"}" "https://XX.XX.XX.XX:443/ConfigurationManager/v1/objects/ldevs"
If you could tell me which API you are trying and what do you want to accomplish then that would be helpful for us to be more specific.
Thanks
------------------------------
Prasenjit Chatterjee
Software Engineer- Test
Hitachi Vantara
------------------------------
Original Message:
Sent: 03-29-2024 06:57
From: Miran Kreuzer
Subject: CURL Command - Invalid JSON Request
Hello,
after a lot of trial and error i wanted to ask for some support for a CURL Request to DetailView Data.
Here is a Curl example i have tried:
curl -k -u admin:PW 'https://localhost:8443/dbapi.do?action=query&dataset=defaultDs&processSync=true' -H 'Content-Type:application/json' -X POST -d '{"query":"hnasFS[@fs_data_read rx b .*]&[@fs_data_written rx b .*]"}'
I have also tried some other queries but i always get this response:
{
"code":"62010002",
"error":"Invalid JSON Request"
}
Maybe somebody has a clue what i have missed within the command Structure.
Thanks a lot in advance!
Regards
Miran
------------------------------
Miran Kreuzer
3 Banken IT GmbH
------------------------------