fix rest API header UI 46/70546/1 1.3.0
authorYarin Dekel <yarind@amdocs.com>
Tue, 16 Oct 2018 09:11:13 +0000 (12:11 +0300)
committerYarin Dekel <yarind@amdocs.com>
Tue, 16 Oct 2018 09:11:58 +0000 (12:11 +0300)
Issue-ID: SDC-1838
Change-Id: Idc02f6df489c8237a6b1c34d18ef3d2d0819f3b6
Signed-off-by: Yarin Dekel <yarind@amdocs.com>
workflow-designer-ui/src/main/frontend/src/services/restAPIUtil.js

index d5c0f9b..05c0d79 100644 (file)
@@ -34,11 +34,6 @@ const POST = 'POST';
 const PUT = 'PUT';
 const DELETE = 'DELETE';
 const PATCH = 'PATCH';
-
-// content-types
-const APPLICATION_JSON = 'application/json';
-const MULTIPART_FORM_DATA = 'multipart/form-data';
-
 const BINARY = 'binary';
 
 const AUTHORIZATION_HEADER = 'X-AUTH-TOKEN';
@@ -89,19 +84,9 @@ function handleSuccess(responseHeaders, requestHeaders) {
 }
 
 class RestAPIUtil {
-    async handleRequest(url, type, options = {}, data) {
+    async handleRequest(url, type, options = {}, data = {}) {
         applySecurity(options, data);
 
-        // TODO see ig necessary or in transformrequest funtion
-        if (type === POST || type === PUT || type === PATCH) {
-            options.headers.contentType =
-                data instanceof FormData
-                    ? MULTIPART_FORM_DATA
-                    : APPLICATION_JSON;
-        } else {
-            data = null;
-        }
-
         let config = {
             method: type,
             url: url,