Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

REST POST form-data content type

$
0
0

I'm attempting to POST through a REST API that has a content type of form-data from vRO. Does anyone have any idea how i need to format the body of the request in vRO? At this point im just building a JSON object then stringifying the object and sending it off.

 

{key1:value1,key2:value2}

 

var body = new Object();
body.api_key = apiKey;
body.AssignedSupportLevel = assignedSupportLevel;
body.Category = category;
body.CustomersUFID = customersUFID;
body.Description = description;
body.LastModifiedByEmail = lastModifiedByEmail;
body.OwnedByTeam = ownedByTeam;
body.Portfolio = portfolio;
body.Priority = priority;
body.Service = service;
body.Source = source;
body.Subcategory = subcategory;
body.Summary = summary;


var request = restHost.createRequest("POST", "/myitapi/v1/tickets", JSON.stringify(body));
request.contentType = "multipart/form-data";


return request.execute();

Viewing all articles
Browse latest Browse all 6251

Trending Articles



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