Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 252940

Re: CURL POST with vCO 5.1 REST API

$
0
0

llian, thanks for the tips !

 

Without single quote and just { }, it works

 

unfotunately I still need to pass quite a lot of parameters, and I won't be able to pass it through crul command line. I created a file without single quote, and tried it, it is still not working.

 

request.txt :

{

"parameters":[
{"name":"folder","value":{"id":"192.168.1.5/group-v22","type":"VC:VmFolder","objectType":"VC:VmFolder","href":"https://192.168.1.7:8281/api/catalog/VC/VmFolder/192.168.1.5%252Fgroup-v22/"},"type":"VC:VmFolder","scope":"LOCAL"},
{"name":"name","value":{"value":"cindy-2","objectType":"string"},"type":"string","scope":"LOCAL"}]

}

 

and I ran curl from windows cmd window:

curl -i -k --user vcoadmin:vcoadmin -X POST -H "Content-Type:application/json" https://192.168.1.7:8281/api/workflows/dec0e608-8b8
3-4e32-8825-3e77ef31c4d7/presentation/instances -d @request.txt

 

curl -i -k --user vcoadmin:vcoadmin -X POST -H "Content-Type:application/json" https://192.168.1.7:8281/api/workflows/dec0e608-8b8
3-4e32-8825-3e77ef31c4d7/presentation/instances -d {\"parameters\":[ ]}

 


same HTTP 400 Bad Request error.


Viewing all articles
Browse latest Browse all 252940

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>