Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void APICALL()
- {
- HttpRequest req = new HttpRequest();
- String endPointURL = 'https://abcwerr.ffff.com/v2/ttttt';
- String userName = 'BlahBlah';
- String password = 'BlahBlah';
- Blob headerValue = Blob.valueOf(userName + ':' + password);
- String authorizationHeader = 'Basic' +
- EncodingUtil.base64Encode(headerValue);
- req.setEndpoint(endPointURL);
- req.setHeader('Content-Type', 'multipart/form-data');
- req.setHeader('Authorization',authorizationHeader);
- req.setMethod('POST');
- string bdy = 'merchant_url='+ AppForm.Business_Website__c;
- req.setbody(EncodingUtil.base64Encode(bdy));
- Http http = new Http();
- HTTPResponse res = http.send(req);
- this.SpiderResponse = res.getBody();
- }
- Blob headerValue = Blob.valueOf(username + ':' + password);
- String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
- r.setHeader('Authorization', authorizationHeader);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement