BG77 - Keep getting +QHTTPPOST: 719 error

Hello there,
I’m trying to send HTTP POST request using my BG77 module and include a JSON body.
In order to do that, according to your docs, I set “requestheader” to 1 and send my own POST request.

Here’s my commands sequence:
AT+QHTTPCFG=“contextid”,1 //OK
AT+QHTTPCFG=“sslctxid”,2 //ssl context 2 includes the requires certificates and key, OK
AT+QHTTPCFG=“requestheader”,1 // OK
AT+QHTTPURL=len,80 //CONNECT
https://myhost/ctrl/mypost?something=somevalue
OK
AT+QHTTPPOST=reqLen,80,80 //CONNECT
POST /ctrl/mypost?something=somevalue HTTP/1.1
Content-Type: application/json
User-Agent: QUECTEL_MODULE
Accept: /
Host: myhost
Accept-Encoding: gzip, deflate, br
Connection: Keep-Alive
Content-Length: 20

{“param1”: “value1”}
OK
+QHTTPPOST: 719

Why does this error returned? what am I missing?
It’s worth mentioning that HTTPGET works perfectly, but POST not.

Thanks in advance

  1. error 719 means than socket has been closed .

2 two advice :slight_smile:

  1. pls check your ssl certificate first .
  2. I attached one examle for your reference, in this example , it enter header and body as empty .

[2019-11-29_13:52:00:503]AT+QHTTPCFG=“sslctxid”,1

[2019-11-29_13:52:00:503]OK
[2019-11-29_13:52:02:230]AT+QSSLCFG=“seclevel”,1,0

[2019-11-29_13:52:02:230]OK
[2019-11-29_13:52:02:933]AT+QHTTPCFG=“responseheader”,1

[2019-11-29_13:52:02:949]OK
[2019-11-29_13:52:03:413]AT+QHTTPCFG=“requestheader”,1

[2019-11-29_13:52:03:413]OK
[2019-11-29_13:52:05:745]AT+QHTTPURL=78,80

[2019-11-29_13:52:05:760]CONNECT
[2019-11-29_13:52:06:298]
[2019-11-29_13:52:06:298]OK
[2019-11-29_13:52:10:661]AT+QHTTPPOST=276,80,80

[2019-11-29_13:52:13:777]CONNECT
[2019-11-29_13:52:23:982]
[2019-11-29_13:52:23:982]OK
[2019-11-29_13:52:24:973]
[2019-11-29_13:52:24:973]+QHTTPPOST: 0,200,91
[2019-11-29_13:52:28:175]AT+QHTTPREAD=80

[2019-11-29_13:52:28:211]CONNECT
[2019-11-29_13:52:28:211]HTTP/1.1 200 OK
[2019-11-29_13:52:28:211]Server: openresty/1.15.8.2
[2019-11-29_13:52:28:211]Date: Fri, 29 Nov 2019 05:52:24 GMT
[2019-11-29_13:52:28:211]Content-Type: application/json; charset=utf-8
[2019-11-29_13:52:28:211]Content-Length: 91
[2019-11-29_13:52:28:211]Connection: keep-alive
[2019-11-29_13:52:28:211]Strict-Transport-Security: max-age=15724800; includeSubDomains
[2019-11-29_13:52:28:216]cache-control: no-store
[2019-11-29_13:52:28:216]pragma: no-cache
[2019-11-29_13:52:28:216]Access-Control-Allow-Origin: *

[2019-11-29_13:52:28:216]{“token_type”:“bearer”,“access_token”:“Ug1j6Qj1rFNZs8GIM88T8iKSVbrOVjaE”,“expires_in”:7200}
[2019-11-29_13:52:28:228]OK

[2019-11-29_13:52:28:228]+QHTTPREAD: 0

3 For more analysis , we need to collect modem log , if need to more assistance , pls reach to
support@quectel.com

Hello @Stephen.Li-Q,
I’ve made some investigation and realized that this error (719) is causes because my POST URL has query parameters in it:

POST /ctrl/mypost?something=somevalue HTTP/1.1

If I remove the ?something=somevalue line, I successfully get response from the server, but I get 400 BAD REQUEST since it must have that query params.
I think you might want to check this issue out…

Thanks again

Hello,

Recently, I faced the same issue and what I did is that I changed a request string to:
“GET https://xxx/path/mypost?something=somevalue HTTP/1.1
Host: https://xxx

It works for me, so hope it would help you guys too.