oci-java-sdk icon indicating copy to clipboard operation
oci-java-sdk copied to clipboard

Support HTTP headers on InvokeFunctionRequest/InvokeFunctionResponse

Open subprotocol opened this issue 3 years ago • 4 comments

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

subprotocol avatar Mar 09 '22 17:03 subprotocol

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 avatar Mar 10 '22 17:03 jodoglevy

@jodoglevy thank you!

subprotocol avatar Mar 10 '22 22:03 subprotocol

@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 avatar Aug 10 '22 16:08 joshunter

@joshunter that is fantastic, thank you!

subprotocol avatar Aug 18 '22 22:08 subprotocol