I have recently starting using libcurl, when I curl via command line it looks like this and POST works fine:
curl -i -X POST http://192.168.1.128:5000/v2.0/tokens -H "Content-Type: application/json" -H "User-Agent: python-keystoneclient" -d {"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "openstack"}}}
This is the Json structure:
{
"auth": {
"tenantName": "admin",
"passwordCredentials": {
"username": "admin",
"password": "0002472e1ab140f2"
}
}
}
How should I write my POSTFIELDS (-d) while curling through a C program because this is incorrect:
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "'{""auth"": {""tenantName"": ""admin"", ""passwordCredentials"": {""username"": ""admin"", ""password"": ""openstack""}}}'");