(self, message: str)
| 68 | @brief See base class for details. |
| 69 | """ |
| 70 | def _Base__send_message(self, message: str): |
| 71 | url = f"{self.host}{self.path}" |
| 72 | if not self.host.startswith("http"): |
| 73 | url = "http://" + url |
| 74 | try: |
| 75 | response = requests.request( |
| 76 | self.method, |
| 77 | url, |
| 78 | headers={ f"{self.header}": message } |
| 79 | ) |
| 80 | if not response.ok: |
| 81 | raise Exception() |
| 82 | if not self.header in response.headers: |
| 83 | return "Nothing sent back from server." |
| 84 | return response.headers[self.header] |
| 85 | except: |
| 86 | raise CommandException(f"Message was not successfully processed.") |
| 87 | |
| 88 | """ |
| 89 | @brief Run a command on the target machine, and return its output as a |
no test coverage detected