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.

1 Like

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}

Hi, I get the expected 3822 because I’m using a device that is “not found”.
This is because the device is not yet registered at my API, so that is all and dandy.
BUT, I would like to read if this is a 401, 404 OR 400, that is I’d like to read the HTTP response code.

How do I do that? I simply cannot find any documentation for this.

Thanks in advance

Hi Jarl:
I want to confirm with you that you want the error codes to be displayed as 404/301/400?
If so,there is no method to configure the error codes at present.

Yes, I would like to be able to see the actual HTTP error code, AND the content.
Getting 401 is completely different that getting 404 and as a client I would have to be able to distinguish between the two.
If not then the HTTP part is more or less useless in i.e. REST calls.

Hi Jarl:
The error code displayed at present is planned by our software and cannot be configured.