oci-java-sdk
oci-java-sdk copied to clipboard
Support HTTP headers on InvokeFunctionRequest/InvokeFunctionResponse
Cloud functions support sending and receiving HTTP headers when invoking functions. The Java SDK does not currently expose setting HTTP headers on InvokeFunctionRequest or getting them off InvokeFunctionResponse.
As a workaround for sending headers, the invocationCallback can be used to indirectly set headers. There is no such workaround for accessing response headers.
It looks easy enough to add in support. Getting headers off responses for example, the information is already on hand and would just need to be added onto: InvokeFunctionRequest.Builder & InvokeFunctionRequest
https://github.com/oracle/oci-java-sdk/blob/master/bmc-functions/src/main/java/com/oracle/bmc/functions/internal/http/InvokeFunctionConverter.java#L89
I'm looking into the feasibility of adding in support for these. Is this something that would be a welcomed contribution?
Thanks
Hi @subprotocol - thanks for reporting this issue. My team can work on adding this support for setting arbitrary HTTP headers in requests from the Java SDK, and for getting arbitrary HTTP headers from responses received in the Java SDK. I think this would need to be a contribution from OCI side, rather than yourself, however, as the files like the one you referenced above are code generated. I'll have someone take a look.
@jodoglevy thank you!
@subprotocol, with yesterday's release you can now see the response headers to the response objects. I am currently working on adding custom headers to requests.
@joshunter that is fantastic, thank you!