Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void request(String S,String cd) {
- string customer_code=cd;
- String SalesOrganization=s;
- String username ='****';
- String password ='*****';
- 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('SalesOrganization='+EncodingUtil.urlEncode(SalesOrganization, 'UTF-8')+'&customer_code='+EncodingUtil.urlEncode(customer_code, 'UTF-8'));
- 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);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement