Hi all,
I'm trying to achieve this by using x++ code. I've a situation where i've to pass the id in json format for which i get some response like "successfully updated". I've set the headers with authorization bearer "token number" i.e been generated via username and password.
Now i'm using below code to acheive my task..
RetailWebRequest request;
RetailWebResponse response;
str getData,
rawResponse,
value;
Map data;
System.Net.HttpWebRequest webReq;
System.Net.HttpWebResponse webRes;
System.IO.Stream stream;
CLRObject clrObj;
System.IO.StreamReader streamRead;
System.IO.StreamWriter streamWrite;
System.Net.ServicePoint servicePt;
System.Net.WebHeaderCollection headers = new System.Net.WebHeaderCollection();
RetailCommonWebAPI webApi = RetailCommonWebAPI::construct();
//headers.Add("Authorization", 'Bearer ' + _value);
response = webApi.makePostRequest("Url","[\{\"Id\":\"13\"}\]",strFmt("%1",'Bearer ' + _value),"application/json");
rawResponse = response.parmData();
data = RetailCommonWebAPI::getMapFromJsonString(rawResponse);
value = data.lookup("");
On response it throws me an error of unhanded exception. Any idea how to set the body and header on makepostRequest method. Any suggestion would be helpful.
Regards,
Zohan

