HTTP Content-Type

Hi All,

I am new to quectel and i bought quectel EC20 EVB.
In my application i am using HTTP and i need to send data in JSON format.

But i cannot find any way to set Content-Type as application/json.

If you know how to set application/json please guide me.

In document only four method is available to set content type.

If content-type = application/json is possible then please explain that steps.

Thanks,
Hardik

AT+QHTTPCFG
+QHTTPCFG: “requestheader”,<request_header>
+QHTTPCFG: “responseheader”,<response_header>

Thanks for reply WizIO,

AT+QHTTPCFG:“requestheader”,1

After that what is step and where i have to give application/json Content-type in which format.


just google :slight_smile:

Thank you WizIO,

Finally i set content-type as application/json using below method…

TEST URL: http://iot.hardikpokar.in/fold/devicereg
TEST PAYLOAD: {“id”:123,“USER”:1}

1)AT+QICSGP=1
2)AT+QIACT=1
3)AT+QIACT?
4)AT+QHTTPCFG=“contextid”,1
5)AT+QHTTPCFG=“requestheader”,1

6)AT+QHTTPURL=41,80
Connect
http://iot.hardikpokar.in/fold/devicereg
OK

7)AT+QHTTPPOST=135,80,80
Connect
POST /fold/devicereg HTTP/1.1
Host: iot.hardikpokar.in
Content-Type: application/json
Accept: /
Content-Length: 19
//Don’t miss this line
{“id”:123,“USER”:1}

OK
8)AT+QHTTPREAD=80

status:success

Thank you,
Hardik

:slight_smile: you welcome …