โ03-01-2017 08:17 AM
For ultra, this is all you need to work with headers, content, and url parameters.
Accessing a URL parameter from an Input request. All url parameters passed on the call in must be accessed in the incoming document and not like a traditional trigger. _paramName does not work.
All URL parameters will come in the โqueryโ object of the input document and each distinct parameter will be represented by an array of the values passed in to those parameters. Most cases youโre only sending one value into one parameter so here in the SS Iโm using the first array element 0.
Content and headers are easier. Your input document you access all incoming headers from the root, and all content from an object named โcontentโ. Ignore the fact that Iโm writing everything to content on the right side, thatโs just something Iโm doing in the pipeline. Please also note that ALL input headers will be cast to lowercase, even if they are sent in as uppercase. Your mapping must reflect this else youโll have problems reading the headers.
Writing out responses is almost exactly the inverse. Minus the addition of status, body content back to the caller is inside of content. Headers are in root, you can send back custom headers. Status code is in a field called โstatusโ