Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Re: FileUploader and X-CSRF-Token?

$
0
0

Hi John,


We are trying approve the workflow decision by POST the HTTP request with Headers (SAP Business Workflow with SAP NetWeaver Gateway version 7.4).

 

HTTP POST with Headers (x-csrf-token)

 

we are following the SAP document  http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/509c922a-aa9a-2f10-328c-d3814560de06?overridelayout=true

 

 

Below the code we are trying the same.

 

var oHeaders = {};

 

oHeaders["x-csrf-token"] = "<?php echo $csrftoken['xcsrfToken'];?>";

oHeaders["Authorization"] = "Basic ZGV2ZWxvcGVyOm5vc2VjcmV0";

 

jQuery.ajax({

    type: "POST",

    url: "http://server:port/sap/opu/odata/IWWRK/WFSERVICE/ApplyDecision?workitem_id='000000072621'&dec_key='0001'&comments='Approved'",

    data: null,

    headers: oHeaders,

    success: successFunc,

    error: errorFuncDefault

});

 

 

function successFunc(data) {

    alert(data);

}

 

function errorFuncDefault(data) {

    alert(data + 'error');

}

 

 

We facing the below errors like Method not supported some time and Authorization failed and we tried all possible ways but no result.

 

Could please help me, where  we are going wrong.

 

Thanks in advances

Venky.


Viewing all articles
Browse latest Browse all 8124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>