Response
Sync
The return type of nc.Client.send() and similar methods is nc.Response, a struct defined in neocurl module. It has no Python constructor and can only be retrieved from the client.
Fields
-
status: strRequest status in a human readable form.
-
status_code: intRequest status as a num. E.g.
200,404,500. -
duration: intTime elapsed to send request and recive a response in milliseconds. Does not include the time to form the request and time to parse the response.
-
body: strResponse body.
-
body_raw: bytesResponse body as bytes.
-
headers: DictResponse headers. A dictionary.
Methods
-
print()Prints information about the response in a human readable form.
Async
The return type of async send functions is nc.AsyncResponses.
Fields
-
responses: nc.Response[]An array of responses.
Methods
-
amount() -> intReturns amount of responses.
-
print_nth(id)Calls
print()on nth element fromresponses.-
id: intId of response to print.
-
-
print_stats(chunk, cut off)Prints responses statistics.
-
chunk: intDuration grouping chunk to use.
-
cut_off: intCut off in percents. If amount is less than cut off, does not print the row.
-