This function package exposes http related related utility functions.
Converts the ‘Cookie’ request header value string to Params object.
http.reqCookieToParams($.headers["Cookie"]) => { "cookie1":"value1", "cookie2":"value2" }
Arg | Type | Description |
---|---|---|
cookies | string | The string from the ‘Cookie’ request header |
Type | Description |
---|---|
params | A string map of cookie name to value |
Converts a Params object to a string suitable for setting ‘Cookie’ request header value.
http.reqCookieFromParams($flow.myCookies) => "cookie1=value1;cookie2=value2"
Arg | Type | Description |
---|---|---|
cookies | params | The params representation of the cookies from the ‘Cookie’ request header |
Type | Description |
---|---|
string | A the string representation of the request cookies |
Converts a cookie from a ‘Set-Cookie’ response header value to an object.
http.resCookieToObject($activity[rest].cookies[0]) => { "Name":"cookie1", "Value":"value1", "Secure":true }
Arg | Type | Description |
---|---|---|
cookie | string | The string cookie from a ‘Set-Cookie’ response header |
Type | Description |
---|---|
object | An object representation of a response cookie |
Converts an Object to a string suitable for setting ‘Set-Cookie’ response header value.
http.resCookieFromObject($flow.myCookie) => "cookie1=value1;Secure"
Arg | Type | Description |
---|---|---|
cookie | any | The object representation of a cookie from a ‘Set-Cookie’ response header, can also be of type map or params |
Type | Description |
---|---|
object | An object representation of a response cookie |
Converts an array of response cookies to a map of cookie objects.
http.resCookiesToObjectMap($activity[rest].cookies) => { "cookie1":{ "Name":"cookie1", "Value":"value1", "Secure":true }}
Arg | Type | Description |
---|---|---|
cookies | array | An array of response cookies from the ‘Set-Cookie’ response headers |
Type | Description |
---|---|
map | A map of cookie objects |
Converts a map of cookie objects to an array of cookie strings suitable for setting ‘Set-Cookie’ response header values.
http.resCookiesFromObjectMap($flow.myCookies) => ["cookie1=value1;Secure"] }
Arg | Type | Description |
---|---|---|
cookies | map | A map of name to cookie object |
Type | Description |
---|---|
array | An array of cookie strings for suitable for setting ‘Set-Cookie’ response headers. |