Open britzl opened 5 years ago
I tried to implement this for SNS and managed to have it working (at least for the request part, handling the response require XML).
I had to remove the content type header (by returning nil
in content_type.lua) and add the action to the query (the only way I managed to do that is by changing aws-sdk/sns.lua).
Do you have a better idea on how to fix this (without changing the generator)?
Hi! I'm happy to work with you on this. I've created a branch where I've started working on this:
https://github.com/britzl/aws-sdk-lua/tree/query_support
Two changes I've made:
Both of the above changes required a small change to the Mustache template.
I haven't tried any of this yet. Some questions:
I found this about query requests: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html
It looks like some requests may be GET request as well, although it doesn't look very common in AWS.
It looks like it doesn't expect any POST data actually, in my tests I just didn't send anything. As for v4 signers, I guess it isn't much different from json protocol (as I did manage to make requests using a slightly modified version of the json protocol file for queries).
Your changes look pretty good in my opinion. It's really nice from you to still work on this.
I'll try to find some time to configure and test an AWS service that uses query requests. You're using SNS right?
For XML parsing I think xml2lua will do just fine: https://github.com/manoelcampos/xml2lua
https://github.com/britzl/aws-sdk-lua/blob/master/aws-sdk/core/request_handlers/query.lua