Http get using 3rd party sim card boron device

I have the following code which works only when using particle sim. If I try to compile the same code with 3rd party sim card (cellular data is ON), it doesnt work. Please help me understand if there is anything I need to enable for 3rd party sim card to do http get.

I am able to get “connected to server success” message, but no response in

void setup()
  // Make sure your Serial Terminal app is closed before powering your device
  // Wait for a USB serial connection for up to 30 seconds
  waitFor(Serial.isConnected, 30000);


  if (client.connect(hostname, 8080))
    Serial.println("connected to server success");
    client.print("GET ");
    client.print(" HTTP/1.0\r\n");
    client.print("HOST: ");
    client.println("Content-Length: 0");

    Serial.println("connection failed");

void loop()
  if (client.available())
     String cmd  = client.readStringUntil('\n'); //;
     Serial.printlnf("%s\n", cmd.c_str());


  if (!client.connected())

If you are running this code with a 3rd party SIM you are missing the SIM selection, the APN setting and the Particle.keepAlive() settings for that provider.

The docs are your friend (don’t mind that it starts off talking about Electron - this also applies to Boron).

However, the samples there seem to be missing the Particle.keepAlive() setting.

Thanks for the reply. Connection to google server seems to be working fine. But I am not able to get any response from our internal sever.
Server is able to receive the http get request from the device.

I am using Boron LTE device with ATT sim in it.

Which HTTP library are you using?