It looks like `uri`, `request_parameters` and the `send_request_cgi` are common to both `#check` and `#http_send_command` except that `cmd` is different, so this should use `http_send_command` with cmd from line 59 and you can eliminate duplicate lines.