EC200U CN - How to Add JWT Token in HTTPS Header (Authorization Bearer)

Hello Quectel Team,

I am using the EC200U-CN module to communicate with my server over HTTPS. I now need to include a JWT token in the Authorization header for secure API access.

What I Am Trying to Do:

I have already enable the customer header by AT+QHTTPCFG=“requestheader”,1
I want to send HTTPS POST requests to my server with the following header:

Authorization: Bearer <jwt-token>

What I Have Tried:


:white_check_mark: Method 1: All headers in a single AT+QHTTPCFG="header" command (comma-separated)

Based on Quectel HTTP AT Commands Manual:

AT+QHTTPCFG="header","Host: <server>","Content-Type: application/x-www-form-urlencoded","Content-Length: 66","Authorization: Bearer <jwt-token>"

:white_check_mark: Method 2: Sending headers one-by-one using multiple AT commands

AT+QHTTPCFG="header","Host: <server>"
AT+QHTTPCFG="header","Content-Type: application/x-www-form-urlencoded"
AT+QHTTPCFG="header","Content-Length: 66"
AT+QHTTPCFG="header","Authorization: Bearer <jwt-token>"

:white_check_mark: Method 3: Including the Authorization header directly in the POST payload

AT+QHTTPURL=68,80
<https://server/api-path>
AT+QHTTPPOST=<complete_size_of_post_data>,80,80
Host: <server>
Content-Type: application/x-www-form-urlencoded
Content-Length: 66
Authorization: Bearer <jwt-token>

device=<id>&sensor=<sensor_id>&swver=<ver>&calver=0&sendc=1

Problem:

Despite trying all three methods:

  • The server either doesn’t receive the Authorization header, or
  • The request fails to go through.
  • I suspect the JWT string length or format might be affecting how the header is parsed or accepted by the module.

Questions:

  • What is the recommended and supported way to add custom headers like JWT tokens in HTTPS requests on EC200U CN?
  • Is there any limit on header length or specific formatting required?
  • Does the module support custom Authorization headers in HTTPS, or only standard ones?

This feature is essential for securing our deployments. Your quick guidance would be highly appreciated.

Thank you,
Sachin

hi
I have been reading this post for a long time. May I ask if further support is needed for this issue?

Thanks

Hello, I want to use HTTPS Authorization: Bearer in version EC25EUXGAR08A19M1G_A0.304.A0.304. I can’t successfully perform GET/POST requests. What should I do? Which commands should I use?

Hi @Mehmet_ali

I have sent an email to follow up through your email address. Kindly check on your side.

  1. Pre-requisite Configuration

    • Confirm AT mode: Run AT to verify module is in AT mode

    • Activate network: Configure PDP context with AT+QICSGP=1, then activate it via AT+QIACT

    • Set HTTP base config:

      AT+QHTTPCFG=“contextid”,1
      AT+QHTTPCFG=“sslctxid”,1
      AT+QHTTPCFG=“requestheader”,1

    • Set TLS version, cipher suite, and certificates matching your server’s requirements

  2. Set Bearer Authorization

    Run: AT+QHTTPCFG=“header”,“Authorization: Bearer <your_token>”

  3. Send Requests

    • GET: Set URL with AT+QHTTPURL=<url_length>,80, then run AT+QHTTPGET=80
    • POST: Set URL with AT+QHTTPURL=<url_length>,80, then run AT+QHTTPPOST=<payload_length>,80,80
  4. After request completes, run AT+QHTTPREAD=80