Skip to content

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

Open
janbarasek wants to merge 2 commits into
nette:masterfrom
janbarasek:patch-5
Open

Request: In case of CLI method should be CLI too.#194
janbarasek wants to merge 2 commits into
nette:masterfrom
janbarasek:patch-5

Conversation

@janbarasek

Copy link
Copy Markdown
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

dg commented Mar 1, 2021

Copy link
Copy Markdown
Member

HTTP method CLI doesn't exist.

@janbarasek

Copy link
Copy Markdown
ContributorAuthor

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

milo commented Mar 1, 2021

Copy link
Copy Markdown
Member

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.

@dg
dgforce-pushed the master branch 10 times, most recently from 5ace0ce to 3affe3aCompareMarch 4, 2021 20:04
@dg
dgforce-pushed the master branch 4 times, most recently from 6ee31b8 to 4f4a403CompareApril 27, 2021 21:33
@dg
dgforce-pushed the master branch 4 times, most recently from a8895b6 to 9409a5fCompareAugust 25, 2021 15:26
@dg
dgforce-pushed the master branch 5 times, most recently from 7b7f9ff to 78bee95CompareSeptember 3, 2021 22:02
@dg
dgforce-pushed the master branch 5 times, most recently from 70207e3 to d3f0e03CompareNovember 29, 2021 19:05
@dg
dgforce-pushed the master branch 2 times, most recently from 0e9377a to 04224e7CompareDecember 12, 2021 17:37
@dg
dgforce-pushed the master branch 3 times, most recently from 59f402a to 32af756CompareOctober 13, 2022 01:29
@dg
dgforce-pushed the master branch 12 times, most recently from ba7eba8 to 7774190CompareNovember 30, 2022 17:29
@dg
dgforce-pushed the master branch 2 times, most recently from c6e0524 to 788ddc4CompareDecember 5, 2022 00:09
Sign up for freeto 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.

3 participants

@janbarasek@dg@milo