Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could we add --xml or --json to add headers needed to call rest api #5203

Closed
nadi-noda opened this issue Apr 8, 2020 · 1 comment
Closed

Could we add --xml or --json to add headers needed to call rest api #5203

nadi-noda opened this issue Apr 8, 2020 · 1 comment

Comments

@nadi-noda
Copy link

@nadi-noda nadi-noda commented Apr 8, 2020

Could we add --xml or --json to add headers needed to call rest api

--xml must add ==> -H 'Content-Type: application/xml' -H "Accept: application/xml"

--json ==> -H 'Content-Type: application/json' -H "Accept: application/json"

Thanks

@nadi-noda nadi-noda changed the title Could we add --xml or --json to add headers needed Could we add --xml or --json to add headers needed to call rest api Apr 8, 2020
@bagder
Copy link
Member

@bagder bagder commented Apr 8, 2020

Very often, those are not actually needed when using rest API even when sending/receiving XML or JSON. But sure, sometimes they are.

Setting Content-Type when doing a GET or any other method without a body would be a bit strange I think.

I think plain --xml and --json are maybe a bit too brief and generic. Maybe --http-json etc? Not sure.

I'm not totally convinced and I will probably not work on this myself any time soon.

Since this is a feature-request, this issue will be closed soon as this is a bug-tracker and this issue is not a bug. If you want to see this feature happen sooner rather than later, a good idea is to start working on it yourself and/or join the mailing list and gather input and interest from other users.

@bagder bagder closed this as completed in 8909865 Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants