cli icon indicating copy to clipboard operation
cli copied to clipboard

Add request HTTP headers to "fn invoke"

Open denismakogon opened this issue 6 years ago • 4 comments
trafficstars

As a user I'd like to specify HTTP headers like fn invoke blah blah --http-header 'Blah: blah'

denismakogon avatar Mar 04 '19 22:03 denismakogon

Doesn't seem unreasonable.

rikgibson avatar Mar 05 '19 14:03 rikgibson

there are two features that I'd like to see as part of the CLI: #546 and this. They both related, the one is all about HTTP headers to make HTTP requests complete and the second one is all about providing a short path to get invoke annotation in order to use it with OCI cURL (or any other HTTP CLI tool).

denismakogon avatar Mar 05 '19 18:03 denismakogon

Just to double check, do you mean something that replicates:

curl -H 'My-header: foo' http://localhost:8080/t/myapp/getheaders-trigger

If so this should be easy enough to do. Just need to watch out for someone doing something like:

fn invoke myapp getheaders --content-type 'application/json' --http-header 'My-header: Foo' --http-header 'Content-Type: text/plain'

vzDevelopment avatar Mar 31 '19 20:03 vzDevelopment

Yeah, my original idea was about doing exactly what you’ve shown. But later I start evaluating this particular feature. Eventually all I need is already implemented in the cURL and the invoke endpoint I can get from fn inspect fn ––endpoint app fn. . So, not sure if it’s really worth it.

denismakogon avatar Mar 31 '19 20:03 denismakogon