M65 Http Post Issue

I am using M65 Module . Oftenly I am getting CME error during HTTP post .
while I have uploaded my data using Postman API 100K time , not a single time I faced any issue .
please look at my code .

bool mygsm_httppost(char* buffer)
{
gsm_printf(“[GSM] HttpPost() Begin\r\n”);
char str[255]={0};
int bufferlen= strlen(buffer);

 if (gsm_lock(10000) == false)

{
gsm_printf(“[GSM] HttpPost() failed!\r\n”);
return false;
}

// memset(&Ans_ATC,0,sizeof(Ans_ATC));
do{		
			sprintf(str,"AT+QHTTPURL=%d,30\r\n",bufferlen-2);
			if(gsm_command(str, 1000 , NULL, 0, 2, "\r\nCONNECT\r\n", "\r\nERROR\r\n")!=1)
			break;				
			sprintf(str,"%s",buffer);
			gsm_printf("\r\n%s\r\n",str);
			if(gsm_command(str, 30000 , NULL, 0, 2, "\r\nOK\r\n", "\r\nERROR\r\n")!=1)
			break;
			if(gsm_command("AT+QHTTPPOST=1,50,10\r\n", 120000 , NULL, 0, 2, "\r\nCONNECT\r\n", "\r\nERROR\r\n")!=1)	
			break;
			if(gsm_command("1\r\n", 50000 , NULL, 0, 2, "\r\nOK\r\n", "\r\nERROR\r\n")!=1)
			break;
			gsm_delay(1);
			if(gsm_command("AT+QHTTPREAD=30\r\n", 50000 , str, sizeof(str), 2, "\r\nCONNECT\r\n", "\r\nERROR\r\n")==1)
			{
			gsm.gprs.Transmit_Success=1;
			break;	
			}				
	}	while(0);							
				if(gsm.gprs.Transmit_Success)			
				{
					memset( &Built_Buffer, 0, sizeof( Built_Buffer));
					strcpy( Built_Buffer,str);
					gsm_unlock();
					return true;
				}
				else			
				{
					gsm.gprs.Transmit_Success=0;
					gsm_printf("\r\n GSM upload Failed\r\n");				
					gsm_unlock();
					return false;
				}						

}

Hi
Did you encounter an error with post or an error with read? Look at the error code. Check the code

Yes I have received error with post and read with above error code.
Maximum time i am getting CME 3815 and 3815. any way to solve this error. I have taken a 5second timout after this error and than below command again
AT+QDEACT

and start whole process again.
please let me know is this a proper process .