Building JSON Request BodiesLast Updated December 16, 2024
Methods are invoked with the JSON protocol by sending a POST request with the method
name in the URL and the method parameters in the body of the request.
The request body for a method invocation is a single JSON object containing the method
parameters as named objects or arrays. For instance, a request body for the
MoveIntoFolder_Task
method might look like this:The method name itself becomes part of the URL, as described in Building JSON Request URLs.
Use the WSDL forms of type names.
WSDL names are shown in the
vSphere Web Services API
reference. For example, use the WSDL name
ApplyHostProfileConfigurationSpec
, rather than the package name
vim.profile.host.ProfileManager.ApplyHostConfigSpec
, to build a
data object as a parameter to the method ApplyEntitiesConfig_Task
.
Similarly, use the method's WSDL name, ApplyEntitiesConfig_Task
,
rather than the source name, applyEntitiesConfiguration
.