http icon indicating copy to clipboard operation
http copied to clipboard

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

Open janbarasek opened this issue 4 years ago • 3 comments

  • 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.

janbarasek avatar Mar 01 '21 09:03 janbarasek

HTTP method CLI doesn't exist.

dg avatar Mar 01 '21 10:03 dg

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?

janbarasek avatar Mar 01 '21 12:03 janbarasek

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.

milo avatar Mar 01 '21 13:03 milo