I am working on POSTing a JSON value to the Business Central.
I am getting below error message
My code looks like below
var
http_req_mes: HttpRequestMessage;
http_cont: HttpContent;
http_clnt: HttpClient;
http_resp: HttpResponseMessage;
outputstring: Text;
begin
http_req_mes.SetRequestUri('http://xxxxTestUsersRaj');
http_req_mes.Method := 'Post';
http_cont.WriteFrom(GeneratePayload());
http_req_mes.Content(http_cont);
http_clnt.UseWindowsAuthentication('xxx', xxxx');
if http_clnt.Send(http_req_mes, http_resp) then
if http_resp.IsSuccessStatusCode then begin
http_resp.Content.ReadAs(outputstring);
Message(Format(outputstring));
end else
Message('Error %1', http_resp.ReasonPhrase);
end;
Also, I investigated that in POSTMAN in the ‘Body’ tab, if I don’t select the JSON in drop down same error occurs.
Let me know how I pass the above value in AL code.
Thanks