Awesome q2a theme

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

0 like 0 dislike
29 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 | 29 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,187 answers
0 comments
40,796 users