I'm writing a driver that will integrate with a vehicle remote starter. The remote starter API authenticates with AWS. Of course, AWS uses a content-type of "application/x-amz-json-1.1" instead of "application/json", but that content type is not supported by the asynchhttpPost() method.
When I try that request, this is the error I get: "No encoder found for request content type application/x-amz-json-1.1"
I think this is a question for the Hubitat developers specifically, but can that content type be supported in an update?
Question for the larger community, is there another way to authenticate with AWS?
I have all the API requests done in postman, and everything works there with the AWS content type. I'm able to authenticate and execute all the vehicle commands, so I know my request format and content are correct.
@joshlobe the sanitized code is below. Interesting idea about changing 1.1 to 1.0, I will try that after work.
The request works using postman or just running the JS version in the browser console, so I'm confident everything is structured correctly.
Since the error I get is "No encoder found for request content type application/x-amz-json-1.1", that makes me think that Hubitat itself doesn't support that request type.
@joshlobe re: quotes - quotes aren't required around keys. Stylistically I'm used to using them but I copy/pasted that line from the developer guide asynchttpPost page (which is unquoted).
@joshlobe re: 1.1 vs 1.0 - Changing it to 1.0 has no effect, hubitat still says there is no encoder.
@thebearmay re: content-type in header: i tried all combinations but the result is the same. The error message "No encoder found for request content type application/x-amz-json-1.1" to me strongly indicates that hubitat is doing some parsing/processing/encoding of the request content type, and that message smells like there is no encoder for application/x-amz-json-1.1 in and the hub doesn't know how to process the request.
@Hubitat_Staff can someone confirm from the development team confirm that my code example has the correct use of requestContentType and the problem is with a missing encoder in Hubitat itself?