adding HTTPie group and argument from httpie-edgegrid
See original GitHub issueHi,
I am working on the plugin httpie-edgegrid to add a --config
parameter to httpie. Thus the user would be able to pass the location of the credentials file (original request here).
Thus I have added the following code:
import httpie.cli.definition as httpie_cli_definition
edgegrid_group = httpie_cli_definition.options.add_group("EdgeGrid")
edgegrid_group.add_argument(
"--config",
action='edgerc',
default='~/.edgerc',
help='.edgerc credentials file (defaults to ~/.edgerc)'
)
httpie_cli_definition.options.finalize()
httpie_cli_definition.parser = httpie_cli_definition.to_argparse(httpie_cli_definition.options)
But when I am issuing a simple httpie command, the parameter does not get recognized:
$ http --auth-type edgegrid -a afadencloud-example-01: --config ./test/sample_edgerc: :/contracts
usage:
http [METHOD] URL [REQUEST_ITEM ...]
error:
unrecognized arguments: --config
for more information:
run 'http --help' or visit https://httpie.io/docs/cli
Httpie-edgegrid seems installed correctly:
$ httpie plugins list
httpie-edgegrid (1.0.2)
httpie_oauth1 (httpie.plugins.auth.v1)
From the documentation and looking at other httpie plugins, I have not seen even if what I am trying is feasible. Could you please help me out? Thanks 👍
Regards,
Roberto
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
HTTPie 3.2.1 (latest) docs
HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible.
Read more >akamai/httpie-edgegrid - GitHub
Plugin for httpie to allow edge grid authentication for Akamai - GitHub ... Once you have the credentials set up, here is an...
Read more >HTTPie prompts for password - Stack Overflow
HTTPie prompts for password ... I am using HTTPie to make edgegrid authenticated calls to a set of REST APIs, but httpie always...
Read more >HTTPie - Akamai TechDocs
HTTPie is a simple command-line client you can use to make Akamai API ... Once you've set up EdgeGrid authentication, you can make...
Read more >Exploring Akamai OPEN APIs from the command line using ...
This will build and install the HTTPie http command line tool to /usr/local/bin and enable the edgegrid authorization module. Verify that the http...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @isidentical ,
That’s what I would call a great pythonic display 😃
It kind of works. The only problem I can see is that
argparse._StoreAction
is an internal class, so importing fromhttpie-edgegrid
is not an easy task. What I have done is copying its__init__()
implementation to myEdgeGridSetterAction
, and then make it extendargparse.Action
directly.This bypass seems to be working, but I need to do more testing.
Thanks once again. I am closing this ticket again, and I hope this time for good 😉
Roberto
Wow @isidentical , I would not have come up with such idea easily. Kudos for you 👍
Now it works locally. Hopefully we will release the new version soon - with this and other changes.
Regards,
Roberto