• SNNair
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
Visualforce:

<apex:page standardController="Lead" extensions="testthustd" >

</apex:page>

Apex code

---
public with sharing class testthustd
{

public testthustd(ApexPages.StandardController stdController)


{


HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();

req.setEndpoint('https://goodle.com/api/v2/job/14/launch');
req.setMethod('POST');

req.setCompressed(false);
//req.setBody('key1=value1&key2=value2');
req.setHeader('Content-type', 'application/json'); 
req.setHeader('Authorization', 'Bearer IYGIUHYwfwifuhwufhoGIYHOIVU'); 
req.setHeader('Content-type', 'application/json'); 



try {
res = http.send(req);
} catch(System.CalloutException e) {
System.debug('Callout error: '+ e);
}
System.debug(res.getBody());


}


}

This is not working.  Please help
Visualforce:

<apex:page standardController="Lead" extensions="testthustd" >

</apex:page>

Apex code

---
public with sharing class testthustd
{

public testthustd(ApexPages.StandardController stdController)


{


HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();

req.setEndpoint('https://goodle.com/api/v2/job/14/launch');
req.setMethod('POST');

req.setCompressed(false);
//req.setBody('key1=value1&key2=value2');
req.setHeader('Content-type', 'application/json'); 
req.setHeader('Authorization', 'Bearer IYGIUHYwfwifuhwufhoGIYHOIVU'); 
req.setHeader('Content-type', 'application/json'); 



try {
res = http.send(req);
} catch(System.CalloutException e) {
System.debug('Callout error: '+ e);
}
System.debug(res.getBody());


}


}

This is not working.  Please help