MKR NB 1500 HTTP Post

I have been using an ESP8266 board for a while to do internet Posts of data to a webservice that I created. I have been using the HTTPClient class to do this.

I am switching my project from WIFI to using Cellular using the MRK NB 1500 with a Verizon Sim card.

The only sample code that I have found for doing HTTP Posts is to build the entire post Using client.println functions. I have tried to get this to work, but so far have not had any luck getting the Posts to work. Here is basically what I am doing:

if (!client.connect(postServer, httpPort))
{
if (DEBUG_MESSAGES) {Serial.println("connection failed");}
LCDMsg = "PM:Conn failed";
return 0;
}
if (DEBUG_MESSAGES) {Serial.println("Body:"+postData);}

client.println(String("POST ") + resource + " HTTP/1.1");
client.println(String("Host: ") + server);
// client.println("Connection: close");
client.println("Content-Type: text/xml; charset=utf-8");
client.print("Content-Length: ");
client.println(postData.length());
client.println("SOAPAction: "" + MyServicePath + "/LogData"");
client.println();
client.println(postData);

If anyone had an Idea of what I am doing wrong, or if I can use something more like the ESP8266 HTTPClient class, please advice. Thanks in advance.

Maybe you rethink the whole idea to send data from the arduino with http and switch to the mqtt protocol?

I finally got this working. It seems that the biggest problem that I had was a delay at the bottom of the Loop function. I changed the logic to get the milliseconds and loop until I it is time to gather information and Post the results again. If you delay, it causes the Modem to do strange things and then the arduino reboots randomly. FIXED.

It is now sending consistently about every 10 minutes without rebooting or any other problems.