You need to sign in to do that
Don't have an account?
Http Callout Issue
Hi Everyone,
I have created endpoint URL for google analytics,
then how to add remaining attributes in HttpRequest ?
For example,,
HttpRequest req = new HttpRequest();
req.setEndpoint('https://www.googleapis.com/analytics/v3/data');
My Question is how to add remaining attribute that mean like (ids=ga%3A731335) in the same class, and how to call this?
HttpRequest req = new HttpRequest();
req.setEndpoint('http://www.yahoo.com');
req.setMethod('GET');
// Specify the required user name and password to access the endpoint
// As well as the header and header information
String username = 'myname';
String password = 'mypwd';
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
// Create a new http object to send the request object
// A response object is generated as a result of the request
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
Hi amit,
Nice to hear from you. I tried this one but unfortantely that was not the answer for this. I mean that was not working.
I am trying to use setheader method to get n no of parameter concat to endpoint to url .I am not sure with that way.
If you know any other way kindly let me know.
Thanks in advance