Outbound REST POST always results in error
I have some code I am developing which will send a simple POST to a 3rd party system API endpoint which is shown below:
/* Create the message object */
&msgOutbound = CreateMessage(@("Operation." | &strOperationname));
/* Set the IB Info */
&IBInfo = &msgOutbound.IBInfo;
&bReturn = &IBInfo.LoadConnectorProp("HTTPTARGET");
&bReturn = &IBInfo.LoadRESTHeaders();
&IBInfo.ConnectorOverride = True;
&IBInfo.IBConnectorInfo.ConnectorClassName = "HttpTargetConnector";
&IBInfo.IBConnectorInfo.ConnectorName = "HTTPTARGET";
&bReturn = &IBInfo.IBConnectorInfo.DeleteConnectorProperties("Content-Type");
&bReturn = &IBInfo.IBConnectorInfo.AddConnectorProperties("Content-Type", &strContentType, %HttpHeader);
If All(&strAuthorization) Then
&bReturn = &IBInfo.IBConnectorInfo.DeleteConnectorProperties("Authorization");
&bReturn = &IBInfo.IBConnectorInfo.AddConnectorProperties("Authorization", &strAuthorization, %HttpHeader);
End-If;
&bReturn = &IBInfo.IBConnectorInfo.DeleteConnectorProperties("URL");
&bReturn = &IBInfo.IBConnectorInfo.AddConnectorProperties("URL", &strURL, %HttpProperty);
&bReturn = &IBInfo.IBConnectorInfo.DeleteConnectorProperties("Method");