@dazn/kopytko-framework 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazn/kopytko-framework",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A modern Roku's Brightscript framework",
5
5
  "keywords": [
6
6
  "brightscript",
@@ -1,5 +1,6 @@
1
1
  ' @import /components/buildUrl.brs from @dazn/kopytko-utils
2
2
  ' @import /components/getProperty.brs from @dazn/kopytko-utils
3
+ ' @import /components/getType.brs from @dazn/kopytko-utils
3
4
  ' @import /components/rokuComponents/Timespan.brs from @dazn/kopytko-utils
4
5
  ' @import /components/rokuComponents/UrlTransfer.brs from @dazn/kopytko-utils
5
6
  ' @import /components/ternary.brs from @dazn/kopytko-utils
@@ -13,6 +14,7 @@
13
14
  ' @property {Object} headers
14
15
  ' @property {Integer} timeout
15
16
  ' @property {Object} body
17
+ ' @property {String} bodyString
16
18
 
17
19
  ' Request logic.
18
20
  ' @class
@@ -51,7 +53,7 @@ function HttpRequest(options as Object, httpInterceptors = [] as Object) as Obje
51
53
  m._urlTransfer.initClientCertificates()
52
54
  end if
53
55
 
54
- if (Type(m._options.headers) = "roAssociativeArray")
56
+ if (getType(m._options.headers) = "roAssociativeArray")
55
57
  m._headers.append(m._options.headers)
56
58
  end if
57
59
 
@@ -79,6 +81,8 @@ function HttpRequest(options as Object, httpInterceptors = [] as Object) as Obje
79
81
 
80
82
  if (m._options.body <> Invalid)
81
83
  body = FormatJSON(m._options.body)
84
+ else if (getType(m._options.bodyString) = "roString")
85
+ body = m._options.bodyString
82
86
  end if
83
87
 
84
88
  m._urlTransfer.asyncPostFromString(body)