function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Writing Test Cases for Http callouts


Can you tell me how to write test cases for Htttp callouts here is the sample code.


public PageReference Send() {


HttpRequest req = new HttpRequest();

    //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???


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........