private void writeJsonDataRequest(HttpURLConnection connection, Request request) {
        try (OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream())) {
            wr.write(request.getJsonPayload().toString());
            wr.flush();
        } catch (IOException e) {
            log.error(e);
        }
    }
private void writeJsonDataRequest ( HttpURLConnection connection , Request request ) { try ( OutputStreamWriter wr = new OutputStreamWriter ( connection . getOutputStream ( ) ) ) { wr . write ( request . getJsonPayload ( ) . toString ( ) ) ; wr . flush ( ) ; } catch ( IOException e ) { log . error ( e ) ; } }
Pushes request data to the open http connection

@param connection - the open connection of the http call
@param request    - the parameters to be passed to the endpoint for the service
call