sim900sim800

Sending multiple post requests with sim800C


I am working on the sim800C board, primarily on sending HTTP post requests.

As I understand from manual and samples online, the process of sending a post request with AT commands involves:

  1. Configuring Bearers: open a bearer and set it up:

    AT+SAPBR=3,1,"APN","CMNET";+SAPBR=1,1;

  2. Do HTTPINIT and then set up parameters:

    AT+HTTPINIT;+HTTPPARA="CID",1;+HTTPPARA="URL","example.url";+HTTPPARA="CONTENT","application/json";

  3. Set request body size and timeout then input the data

    AT+HTTPDATA=90,10000
    {"test":"test-conent"}
    
  4. Start post session and read response(if needed. In my case, I only care about status code)

    AT+HTTPACTION=1

  5. Terminate HTTP service and close bearer

    AT+HTTPTERM
    
  6. Close bearer

    AT+SAPBR=0,1
    

My question is, are any of these steps reusable if I'm sending multiple post requests? Closing and re-opening the bearer over and over can be really time-consuming, compared with other settings steps.

I have tried using the same bearer for multiple requests but got 601 status code after the first one. Is there a workaround to reuse the same bearer but still make multiple posts wit it?


Solution

  • Found the answer myself after testing: step 2-5 are reusable.