Qhttppost cme error 3822

HELLO,
When I send QHTTPOST Cammand on m66, then first I get CONNECT successfully but after if I send the data on the server it replies me CME ERROR 3822 i.e. HTTP Response Failed. I dont know why it is coming because I also tested on api tester i got OK as a reply. Thank you in advance.

CME ERROR 3822 is usually cause by getting HTTP 400 bad request or 404 not found or 401 authorization fail. It could be cause the POST content is not accept by server or format incorrect. You would need to check the POST content and format.

Hi sir,

How to configure Content-type as application/json in quectel EC20

In EC20 we have command to configure the content type.
AT+QHTTPCFG=“contenttype”,<0-3>
<content_type> Numeric type. Data type of HTTP(S) body.
0 application/x-www-form-urlencoded
1 text/plain
2 application/octet-stream
3 multipart/form-data

If you want to use content-type application/json, you would need to use the customize HTTP header mode.
AT+QHTTPCFG=“requestheader”,1 //1: customize header mode 0: body only mode.
In customize header mode, you need to include the HTTP header in the QHTTPPOST command. You can also use GET/PUT/DELETE method with this command.

Thanks Willie Yao,

My actual Payload is

AT+HTTPPOST=19,80,80
{“Id”:121,“User”:1}
.

Now i want to set content type as application/json ,so i need to send with payload like this…

AT+HTTPPOST=43,80,80
content:application/json{“Id”:121,“User”:1}

Is this correct format to send or wrong .

If wrong then please correct me .

Thank you

Here is an example for your reference:
// URL: hf.quectel.com:8005/Willie/QuectelTest.Text
AT+QHTTPPOST=152,80,80

POST /Willie/QuectelTest.txt HTTP/1.1
Host: hf.quectel.com:8005
Content-Type: application/json
Accept: /
Content-Length: 19
//Don’t miss this line break.
{“Id”:121,“User”:1}