Updating the configuration of a Flex instance requires a POST request to be made with a JSON payload. This change lays the foundations to support this. This is highlighted in https://github.com/twilio/twilio-oai-generator/issues/49
The PostJson accepts an interface for the request body (data) instead of just a map as this prevents the computational overhead of having to marshal the struct to a slice of bytes then create a string from the bytes. The JSON string would then be unmarshalled to a map and then marshalled again to a slice of bytes
This change makes the Content-Type header mandatory for POST requests
Checklist
[x] I acknowledge that all my contributions will be made under the project's license
[x] I have made a material change to the repo (functionality, testing, spelling, grammar)
Updating the configuration of a Flex instance requires a POST request to be made with a JSON payload. This change lays the foundations to support this. This is highlighted in https://github.com/twilio/twilio-oai-generator/issues/49
The PostJson accepts an interface for the request body (data) instead of just a map as this prevents the computational overhead of having to marshal the struct to a slice of bytes then create a string from the bytes. The JSON string would then be unmarshalled to a map and then marshalled again to a slice of bytes
This change makes the
Content-Type
header mandatory for POST requestsChecklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.