Why is the answer type is passed to the method as a variable?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
12 views
In most web frameworks use the following design:
def on_get(self, req, resp):
It is not clear why always resp is received in the function processor. This is the answer. We do not accept, and to return to.
by | 12 views

2 Answers

0 like 0 dislike
So you can't copy-paste everywhere the constructor of the response is transmitted blank. And Yes, not "most" and asynchronous/non-blocking, because in the synchronous classes of responses are primitive and are only used after completion of the response.
by
0 like 0 dislike
This is a project that you must complete. In functional languages this could be the return value, but it is difficult to convey to another asynchronous function. Synthetic example:

asyncSetHeaders(resp)

From a less synthetic example is the need to make an asynchronous request, in order to form a response
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
35,430 users