Not understanding why I am getting this error if I check this URL in Soap UI it is working perfectly. Getting this error after setting body 'Input is not valid JSON at character 1 of '
public static void request(String S,String cd) {
string customer_code=cd;
String SalesOrganization=s;
String username ='****';
String password ='*****';
string payload='[{"SalesOrganization" : "solidealusa","customer_code" : "CS000023"}]';
Blob headerValue = Blob.valueOf(username+':'+password);
String authorizationHeader ='BASIC'+EncodingUtil.base64Encode(headerValue);
HttpRequest req = new HttpRequest();
req.setEndpoint('https://da1.camso.co:50001/RESTAdapter/sold_to/batch');
req.setMethod('POST');
req.setHeader('Authorization', authorizationHeader);
req.setBody(payload);
req.setCompressed(false); // otherwise we hit a limit of 32000
try
{
HttpResponse res = new Http().send(req);
system.debug('Response' +res.getBody());
} catch(System.CalloutException e) {
System.debug('Callout error: '+ e);
}
}