You need to sign in to do that
Don't have an account?
![Lee.ax1423 Lee.ax1423](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Writing Test Cases for Http callouts
Hi,
Can you tell me how to write test cases for Htttp callouts here is the sample code.
public PageReference Send() {
HttpRequest req = new HttpRequest();
req.setEndpoint('url');
req.setMethod('GET');
//send the request
Http http = new Http();
HttpResponse res = http.send(req);
//check the response
if (res.getStatusCode() == 200) {
//do something//
} else {
//do something
}
can you help me???
Look at these posts...it will help you
http://boards.developerforce.com/t5/Apex-Code-Development/Trigger-sends-SMS-with-HTTP-need-help-with-test-method/m-p/208206/highlight/true#M36698
http://boards.developerforce.com/t5/Apex-Code-Development/Testing-an-Apex-Class-with-Future-Help-Needed/m-p/211719/highlight/true#M37635
Thnks for replying me,
but still i am confusing to write unit test cases for http callouts.
can you write unit test for above mentioned code........
thanks advance........