/
USB Connect LPWA - HTTP Bearer Authentication
USB Connect LPWA - HTTP Bearer Authentication
The following documentation describes how you can use Bearer Autorisation tokens with HTTP and which AT commands you have to use. As a starting point we use https://httpbin.org/
// Set verbose error result codes.
AT+CMEE=2
OK
// Reset the HTTP profile #0
AT+UHTTP=0
OK
// Set the server domain name
AT+UHTTP=0,1,"httpbin.org"
OK
// Set the port of the HTTP request to 80
AT+UHTTP=0,5,80
OK
// Add custom request headers
AT+UHTTP=0,9,"1:Authorization:Bearer MY_TOKEN"
OK
// Submit a get command in text format and store the answer in result.txt
AT+UHTTPC=0,1,"/bearer","result.txt"
OK
# Wait of URC
+UUHTTPCR: 0,1,1
// Check the server response
AT+URDFILE="result.txt"
+URDFILE: "result.txt",276,"HTTP/1.1 200 OK
Date: Wed, 23 Oct 2024 16:27:59 GMT
Content-Type: application/json
Content-Length: 52
Connection: close
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"authenticated": true,
"token": "MY_TOKEN"
}
"
OK
, multiple selections available,
Related content
Integration of USB Connect LPWA into Vodafones business IOT device management platform with Bootstrap
Integration of USB Connect LPWA into Vodafones business IOT device management platform with Bootstrap
More like this
USB Connect LPWA 3.2 - Network connections with Network Manager
USB Connect LPWA 3.2 - Network connections with Network Manager
More like this
USB Connect LPWA 3.2 - Production setup
USB Connect LPWA 3.2 - Production setup
More like this
Integration of USB Connect LPWE into Vodafones business IOT device management platform
Integration of USB Connect LPWE into Vodafones business IOT device management platform
More like this
Getting Started
Getting Started
More like this