Store HTTP response in a variable

I am doing a GET request and am trying to save the response as a variable so the response data can be parsed.

Below is the GET request code. The output of the request is JSON format.

   Adafruit_CC3000_Client apiWebSiteClient = cc3000.connectTCP(ip, 80);

  // GET: Roaster status. Requires JWT in Authorization header
  if (apiWebSiteClient.connected()) {
    apiWebSiteClient.fastrprint(F("GET "));
    apiWebSiteClient.fastrprint(apiWEBPAGE);
    apiWebSiteClient.fastrprint(F(" HTTP/1.1\r\n"));
    apiWebSiteClient.fastrprint(F("Host: ")); apiWebSiteClient.fastrprint(WEBSITE); apiWebSiteClient.fastrprint(F("\r\n"));
    apiWebSiteClient.fastrprint(F("\r\n"));
    apiWebSiteClient.println();
  } else {
    Serial.println(F("Connection failed"));    
    return;
  }

Thanks!

Depending on how picky your web server is you might miss some fields to have a well formed GET request

I suggest you telnet manually in a terminal to your server on the right port and enter the GET command exactly as above and see what you get back

Once you get the json (and most likely some other chars) back, you are ready to implement a while loop on the incoming serial to read each char as it comes in, add it to a buffer and loop until you find the end of that GET request.

The Adafruit_CC3000_Client class has a read() method.
Try something like Serial.print( apiWebSiteClient.read() ) or even look at the documentation for the class.