Arduino HTTP Request TinyGSM

I'm using TinyGMS library to make HTTP requests with SIM800L module. Please note that I have two SoftwareSerial, one for GSM and another for GPS.

To do that I have the following code:

void make_request() {
 gps_serial.end();
 smartdelay(10);
 gsm.flush();     
 smartdelay(10);     
 gsm.listen();
 smartdelay(10);
initModem();

digitalWrite(REQUEST_LED, HIGH);
if(modem.gprsConnect(apn, "", "")) {
    #ifdef DEBUGGING
        Serial.println("GPRS CONNECT");
    #endif
} else {
    #ifdef DEBUGGING
        Serial.println("GPRS FAIL");
    #endif    
}

if (!client.connect(server, port)) {
    #ifdef DEBUGGING
        Serial.println(" fail server");
    #endif
    return;
}
#ifdef DEBUGGING
    Serial.println(" OK"); 
    Serial.println(request);
#endif
client.print(request);
client.print(String("Host: ") + server + "\r\n");
client.print("Connection: close\r\n\r\n");
String response;
unsigned long timeout = millis();
Serial.println("MILLIS");
Serial.println(timeout);
while (client.connected()) {
    while (client.available()) {            
        char c = client.read();      
        response.concat(c);
        if (response.endsWith("403 Forbidden")) {
            // TODO Counter to error
            #ifdef DEBUGGING
                Serial.println("403 Forbidden");
            #endif
            return;
        }
        timeout = millis();
    }
} 

client.stop();
smartdelay(10);
if(!client.connected()) {
    #ifdef DEBUGGING
        Serial.println();
        Serial.println("Server disconnected");
    #endif
}

if(modem.gprsDisconnect()) {
    #ifdef DEBUGGING
        Serial.println("GPRS disconnected");
    #endif
}

digitalWrite(REQUEST_LED, LOW);    

return response;  
}

The problem is that when I'm receiving the response it comes incomplete. As seen below.

HTTP/1.0 200 OK
Date: Mon, 17 Apr 2017 19:18:07 GMT
Server: WSGIServer/0.2 CPython/3.4.3+
X-Frame-Options: SAMEORIGIN
Allow: GET, HEAD, OPTIONS
Vary: Accept, Cookie
ConP
z�z�ication/json
Con

What am I possibly doing wrong?

The problems seems to be related with code flow. I've started from scratch and now it is running ok.. Thanks.

Hi!

I am trying to do the same thing here: listen to Neo-6M GPS reciever (Using tinyGPS) and to forward location information using HTTP GET request via SIM800L.

I am using 2 SoftwareSerial objects, (pins 3,4 and 9,10). The code works well when using only one SoftwareSerial, but when I use both, one supresses the other.

Could you be so kind to paste your solution of time-sharing of SoftwareSerial objects?

Thanks in advance.

Endre