1

Our Gemalto Module only allows 127 characters for HTTP header data. Is there a possibility to shorten the "Content-Type" header because currently both headers together (Authorization and Content-Type) exceed the 127 characters.

If this is not possible is there a way to do the device registration via SmartREST and not use the "Content-Type" header.

1 Answers1

0

It is possible to use "application/json" instead of the API specific Content-Type. This will be much shorter but to receive an answer from a POST request you also need an Accept header (here you can also use "application/json") at the Cumulocity APIs.

So you will end up with Content-Type, Accept, Authorization header plus the Host header.

Doing the device registration via SmartREST will certainly fit into the 127 characters. You just need the Authorization header. If you are only doing device device registration you don't need a SmartREST template and no X-Id header.

Here is an example:

POST /s HTTP/1.1
Host: ...
Authorization: Basic ...

61,test_id

The "61" is the specific template id to do device regsitration and the "test_id" would be the id you use for registration (e.g. serial number, max address, ...)

The SmartREST request will return

50,1,404,Not Found

until the device registration was accepted and then it will return

70,1,test_id,tenant,username,password
TyrManuZ
  • 2,039
  • 1
  • 14
  • 23