Closed MoonBow-1 closed 8 months ago
Currently sending requests only returns an HttpResponse object, which is then individually logged by the sender.
The plan is to log the response at the client level, and not use the same duplicate code after returning the HttpResponse object.
Logging is simple and universal with this:
if (response == null) { Typewriter.technical_error("Response was null"); } else if (response.statusCode() == 201 || response.statusCode() == 200) { Typewriter.response(response.body()); } else { Typewriter.errorResponse(response.body()); }
Currently: Client is first initialized, then a request is generated from the client object and stored in a var, then client is called with that var.
Plan is to make that var into the client object, and just call void methods to send it, and add store the response inside the client object.
These changes also will improve the CaptureDefWithSink objects by removing a method from both. Elsewhere these changes remove 6-9 lines of code.
All changes done in commit 9f641203, moving ticket to QA
9f641203
Merged
Currently sending requests only returns an HttpResponse object, which is then individually logged by the sender.
The plan is to log the response at the client level, and not use the same duplicate code after returning the HttpResponse object.
Logging is simple and universal with this:
Currently: Client is first initialized, then a request is generated from the client object and stored in a var, then client is called with that var.
Plan is to make that var into the client object, and just call void methods to send it, and add store the response inside the client object.