@micropermit/client-angular 0.3.2 → 0.4.1

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.
@@ -1437,6 +1437,7 @@
1437
1437
  this.entryPointSubject = new rxjs.ReplaySubject();
1438
1438
  this.usePost = true;
1439
1439
  this.sendAsPermitTokenHeader = true;
1440
+ this.sendAsMultipartFormData = false;
1440
1441
  }
1441
1442
  /**
1442
1443
  * @param {?} sendAsPermitTokenHeader
@@ -1697,7 +1698,7 @@
1697
1698
  if (this.urlRewriter) {
1698
1699
  url = this.urlRewriter(url);
1699
1700
  }
1700
- httpObs = this.httpClient.post(url, body, {
1701
+ httpObs = this.httpClient.post(url, this.encodeBody(body), {
1701
1702
  headers: requestHeaders
1702
1703
  });
1703
1704
  }
@@ -1725,6 +1726,27 @@
1725
1726
  })), this.catchAndHandleError());
1726
1727
  return httpObs;
1727
1728
  };
1729
+ /**
1730
+ * @private
1731
+ * @param {?} body
1732
+ * @return {?}
1733
+ */
1734
+ MicroClient.prototype.encodeBody = /**
1735
+ * @private
1736
+ * @param {?} body
1737
+ * @return {?}
1738
+ */
1739
+ function (body) {
1740
+ if (this.sendAsMultipartFormData) {
1741
+ /** @type {?} */
1742
+ var formData = new FormData();
1743
+ formData.append('', JSON.stringify(body));
1744
+ return formData;
1745
+ }
1746
+ else {
1747
+ return body;
1748
+ }
1749
+ };
1728
1750
  /**
1729
1751
  * @private
1730
1752
  * @template T
@@ -1910,6 +1932,8 @@
1910
1932
  MicroClient.prototype.usePost;
1911
1933
  /** @type {?} */
1912
1934
  MicroClient.prototype.sendAsPermitTokenHeader;
1935
+ /** @type {?} */
1936
+ MicroClient.prototype.sendAsMultipartFormData;
1913
1937
  /**
1914
1938
  * @type {?}
1915
1939
  * @private