In this case, use
@future(callout=true)
public static void post(String u, String p)
{
try
{
HttpRequest req = new HttpRequest();
............................................................
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug('Response is ' + res.getBody());
..................................................................
..................................................................
..................................................................
}
catch(Exception e)
{
..................................................................
..................................................................
}
}
Cheers!!!
@future(callout=true)
public static void post(String u, String p)
{
try
{
HttpRequest req = new HttpRequest();
............................................................
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug('Response is ' + res.getBody());
..................................................................
..................................................................
..................................................................
}
catch(Exception e)
{
..................................................................
..................................................................
}
}
Cheers!!!
No comments:
Post a Comment