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

Request: In case of CLI method should be CLI too. #194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

janbarasek
Copy link
Contributor

  • new feature
  • BC break? yes

In the case of obtaining a service for an Http Request in CLI mode, it does not make sense for the call method to be GET when no request exists.

I think Request should either throw an exception that cannot be used in a CLI context, or it should return a special CLI method.

Current behavior looks illogical:

Screenshot from 2021-03-01 10-06-40

Thanks.

@dg
Copy link
Member

dg commented Mar 1, 2021

HTTP method CLI doesn't exist.

@janbarasek
Copy link
Contributor Author

I don't know how to better represent this (if at all).

When obtaining the current Request from the DI, it should be possible to verify that the Request was created artificially in CLI mode and is not a real request. In that case, I can't rely on a number of things, such as URLs.

What do you think?

@milo
Copy link
Member

milo commented Mar 1, 2021

In a strict way - an HTTP request can be automatically created only via HTTP protocol so exception is more accurate. In practice - I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants